Skip to content

Commit

Permalink
Add gender facet (RPB-38)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Dec 18, 2023
1 parent cbce42e commit ce6ca84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public HomeController(WSClient httpClient) {

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

@Inject
Environment env;
Expand Down
5 changes: 3 additions & 2 deletions app/views/search.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
@defining((Json.parse(result) \ "aggregation" \ key).asOpt[Seq[JsValue]].getOrElse(Seq())) { buckets =>
@if(!buckets.isEmpty) {
@defining(key.replace(".id", "").replace(".label.keyword", "")) { simpleKey =>
<h5>@models.GndOntology.label(simpleKey) @if(buckets.size>7){
<h5>@models.GndOntology.label(simpleKey) @if(buckets.size>5){
<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();">
<span class="octicon octicon-diff-added" aria-hidden="true"></span>
Expand All @@ -127,7 +127,7 @@ <h5>@models.GndOntology.label(simpleKey) @if(buckets.size>7){
(bucket, bIndex) <- buckets.zipWithIndex;
term = (bucket \ "key").as[String];
count = (bucket \ "doc_count").as[Int]) {
<span @if(bIndex>6){style="display:none" class="@simpleKey-more-item"}>
<span @if(bIndex>4){style="display:none" class="@simpleKey-more-item"}>
@facetLink(key, "\"" + term + "\"", models.GndOntology.label(term), count) <br/>
</span>
}
Expand Down Expand Up @@ -232,6 +232,7 @@ <h4>Ergebnisse eingrenzen:</h4>
@*@typeFacet(buckets)*@
@facet("professionOrOccupation.label.keyword")
@facet("gndSubjectCategory.id")
@facet("gender.id")
@facet("placeOfActivity.label.keyword")
@facet("geographicAreaCode.id")
@*@facet("professionOrOccupation.id")*@
Expand Down

0 comments on commit ce6ca84

Please sign in to comment.