Skip to content

Commit

Permalink
Add setup to avoid specific entities on start page (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsteeg committed Oct 10, 2022
1 parent 2c3f79d commit e2b4e0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ public Result redirectSlash(String path) {
}

public Result index() {
QueryStringQueryBuilder query = index.queryStringQuery("depiction:*");
String queryString = "depiction:*";
for (String dont : CONFIG.getStringList("dontShowOnMainPage")) {
queryString += " AND NOT gndIdentifier:" + dont;
}
QueryStringQueryBuilder query = index.queryStringQuery(queryString);
FunctionScoreQueryBuilder functionScoreQuery = QueryBuilders.functionScoreQuery(query,
ScoreFunctionBuilders.randomFunction(System.currentTimeMillis()));
SearchRequestBuilder requestBuilder = index.client().prepareSearch(config("index.prod.name"))
Expand Down
2 changes: 2 additions & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

host : "https://lobid.org"

dontShowOnMainPage: ["1012979-0"]

play {
http.secret.key=""
filters.disabled+=play.filters.hosts.AllowedHostsFilter
Expand Down

0 comments on commit e2b4e0c

Please sign in to comment.