Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Elasticsearch Services
Search Doc Service
Commits
eae213bd
Commit
eae213bd
authored
Mar 26, 2021
by
Jonas Waeber
Browse files
Records sets an be held by multiple institutions.
parent
395317d1
Pipeline
#23867
passed with stages
in 4 minutes and 59 seconds
Changes
4
Pipelines
2
Expand all
Show whitespace changes
Inline
Side-by-side
src/main/kotlin/RecordSetSearchDocBuilder.kt
View file @
eae213bd
...
...
@@ -24,6 +24,7 @@ import ch.memobase.rdf.NS
import
ch.memobase.rdf.RDA
import
ch.memobase.rdf.RICO
import
ch.memobase.rdf.RICO.Types.RecordSet
import
com.beust.klaxon.JsonArray
import
com.beust.klaxon.JsonObject
import
org.apache.logging.log4j.LogManager
import
org.memobase.helpers.Date
...
...
@@ -114,8 +115,15 @@ class RecordSetSearchDocBuilder(private val elasticSearchWrapper: ElasticSearchW
}
val
uri
=
recordSet
[
KEYS
.
entityId
]
as
String
val
id
=
uri
.
substringAfterLast
(
"/"
)
val
institution
=
recordSet
[
RICO
.
heldBy
.
localName
]
as
String
val
institutionId
=
institution
.
substringAfterLast
(
"/"
)
val
institutions
=
when
(
val
value
=
recordSet
[
RICO
.
heldBy
.
localName
])
{
is
String
->
listOf
(
value
)
is
JsonArray
<
*
>
->
value
as
List
<
String
>
else
->
{
log
.
error
(
"No institutions found for record set $id."
)
emptyList
()
}
}
val
institutionIds
=
institutions
.
map
{
it
.
substringAfterLast
(
"/"
)
}
val
description
=
extractLanguageContainer
(
recordSet
[
RICO
.
descriptiveNote
.
localName
],
""
)
val
rights
=
extractLanguageContainer
(
recordSet
[
RICO
.
conditionsOfUse
.
localName
],
""
)
...
...
@@ -142,7 +150,7 @@ class RecordSetSearchDocBuilder(private val elasticSearchWrapper: ElasticSearchW
}
},
periodOfTimeAsYear
=
date
,
institution
=
elasticSearchWrapper
.
getInstitutionName
(
i
nstitutionId
)
,
institution
=
institutionIds
.
map
{
elasticSearchWrapper
.
getInstitutionName
(
i
t
)
}
,
supportedByMemoriav
=
recordSet
[
KEYS
.
sponsoredBy
]
!=
null
,
name
=
name
,
documentType
=
elasticSearchWrapper
.
getDocumentTypesFromRecords
(
id
,
KEYS
.
QueryFields
.
recordSetFacet
),
...
...
src/main/kotlin/model/RecordSetSearchDoc.kt
View file @
eae213bd
...
...
@@ -37,7 +37,7 @@ data class RecordSetSearchDoc(
val
periodOfTimeAsYear
:
IntegerRange
?,
val
supportedByMemoriav
:
Boolean
,
val
languageOfMetadata
:
List
<
FacetContainer
>,
val
institution
:
FacetContainer
,
val
institution
:
List
<
FacetContainer
>
,
// Sort
val
lastUpdatedDate
:
String
,
...
...
@@ -86,11 +86,7 @@ data class RecordSetSearchDoc(
facet
=
emptyList
()
)
),
institution
=
FacetContainer
(
LanguageContainer
.
placeholder
(
"TEST INSTITUTION"
),
filter
=
"INSTITUTION_IDENTIFIER"
,
facet
=
emptyList
()
),
institution
=
emptyList
(),
periodOfTimeAsYear
=
IntegerRange
(
2000
,
2020
),
lastUpdatedDate
=
"2020-11-20T10:29:01.128"
,
keyVisualLink
=
"https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2020-10/1.jpg?itok=5ncVBnVQ"
,
...
...
src/test/resources/data/recordSets/completeExampleOutput.json
View file @
eae213bd
This diff is collapsed.
Click to expand it.
src/test/resources/data/recordSets/default_record_set.json
View file @
eae213bd
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment