Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nomad-lab-base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
nomad-lab-base
Commits
f63e28b8
Commit
f63e28b8
authored
6 years ago
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
Options
Downloads
Patches
Plain Diff
split analyzer for main_file_uri and secondary_file_uris
parent
5af3cea7
No related branches found
No related tags found
No related merge requests found
Pipeline
#40754
failed
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
repo/repo-base/src/main/scala/eu/nomad_lab/repo/objects/Calculation.scala
+11
-3
11 additions, 3 deletions
...rc/main/scala/eu/nomad_lab/repo/objects/Calculation.scala
with
11 additions
and
3 deletions
repo/repo-base/src/main/scala/eu/nomad_lab/repo/objects/Calculation.scala
+
11
−
3
View file @
f63e28b8
...
...
@@ -20,6 +20,7 @@ package eu.nomad_lab.repo.objects
import
com.sksamuel.elastic4s.http.
{
ElasticDsl
=>
ES
}
import
com.sksamuel.elastic4s.mappings.dynamictemplate.DynamicMapping
import
com.sksamuel.elastic4s.mappings.
{
FieldDefinition
,
MappingDefinition
,
ObjectFieldDefinition
}
import
com.sksamuel.elastic4s.analyzers.AnalyzerDefinition
import
eu.nomad_lab.
{
Base32
,
CompactSha
,
LocalEnv
}
import
eu.nomad_lab.elasticsearch.ConnectorElasticSearch
...
...
@@ -34,8 +35,8 @@ object Calculation {
def
fieldDefinition
:
FieldDefinition
=
{
ES
.
objectField
(
sectionName
).
fields
(
Seq
(
ES
.
keyword
Field
(
"main_file_uri"
),
ES
.
keyword
Field
(
"secondary_file_uris"
),
ES
.
text
Field
(
"main_file_uri"
)
.
analyzer
(
"pathSplitter"
)
,
ES
.
text
Field
(
"secondary_file_uris"
)
.
analyzer
(
"pathSplitter"
)
,
ES
.
keywordField
(
"repository_filepaths"
).
index
(
false
),
ES
.
keywordField
(
"repository_archive_gid"
),
ES
.
longField
(
"repository_calc_id"
).
stored
(
true
),
...
...
@@ -50,6 +51,13 @@ object Calculation {
)
}
/**
* Analyzers used by the fields
*/
def
analysis
:
Seq
[
AnalyzerDefinition
]
=
{
Seq
(
ES
.
patternAnalyzer
(
"pathSplitter"
,
"/+"
))
}
/**
* Mapping (index definition) of a calculation
*/
...
...
@@ -158,4 +166,4 @@ case class Calculation(
)
}
case
class
CalculationWrapper
(
section_repository_info
:
Calculation
)
\ No newline at end of file
case
class
CalculationWrapper
(
section_repository_info
:
Calculation
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment