Skip to content

Commit

Permalink
Tweak professionOrOccupation, placeOfActivity settings (RPB-38)
Browse files Browse the repository at this point in the history
Set type to `text`, add `keyword` subfield for facets
  • Loading branch information
fsteeg committed Nov 29, 2023
1 parent 90b6045 commit 6cb3376
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/controllers/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public HomeController(WSClient httpClient) {
}

public static final String[] AGGREGATIONS = new String[] { "type", "gndSubjectCategory.id", "geographicAreaCode.id",
"professionOrOccupation.id", "professionOrOccupation.label", "placeOfActivity.label", "dateOfBirth" };
"professionOrOccupation.id", "professionOrOccupation.label.keyword", "placeOfActivity.label.keyword",
"dateOfBirth" };

@Inject
Environment env;
Expand Down
6 changes: 3 additions & 3 deletions app/views/search.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
@facet(key: String) = {
@defining((Json.parse(result) \ "aggregation" \ key).asOpt[Seq[JsValue]].getOrElse(Seq())) { buckets =>
@if(!buckets.isEmpty) {
@defining(key.replace(".id", "").replace(".label", "")) { simpleKey =>
@defining(key.replace(".id", "").replace(".label.keyword", "")) { simpleKey =>
<h5>@models.GndOntology.label(simpleKey) @if(buckets.size>7){
<a id="@simpleKey-more-link" href="javascript:void(0)" title="Mehr Werte anzeigen"
onclick="$('.@simpleKey-more-item').show(); $('#@simpleKey-more-link').hide(); $('#@simpleKey-less-link').show();">
Expand Down Expand Up @@ -230,9 +230,9 @@ <h5>@models.GndOntology.label("type")</h5>
@if(!buckets.isEmpty) {
<h4>Ergebnisse eingrenzen:</h4>
@*@typeFacet(buckets)*@
@facet("professionOrOccupation.label")
@facet("professionOrOccupation.label.keyword")
@facet("gndSubjectCategory.id")
@facet("placeOfActivity.label")
@facet("placeOfActivity.label.keyword")
@facet("geographicAreaCode.id")
@*@facet("professionOrOccupation.id")*@
@*@facet("dateOfBirth")*@
Expand Down
14 changes: 12 additions & 2 deletions conf/index-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,24 @@
"professionOrOccupation": {
"properties" : {
"label": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
},
"placeOfActivity": {
"properties" : {
"label": {
"type": "keyword"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
Expand Down

0 comments on commit 6cb3376

Please sign in to comment.