Skip to content

Commit

Permalink
Simplify query
Browse files Browse the repository at this point in the history
Complements 4cc55fc
  • Loading branch information
dr0i committed Nov 7, 2023
1 parent 991f8df commit ea379ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/nwbib/Classification.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ public static List<String> toJsonLd(final URL turtleUrl) {
*/
public static JsonNode ids(String q, String t) {
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
.should(QueryBuilders.idsQuery(Type.NWBIB.elasticsearchType,
Type.SPATIAL.elasticsearchType).ids(q))
.minimumNumberShouldMatch(1);
.must(QueryBuilders.idsQuery(Type.NWBIB.elasticsearchType,
Type.SPATIAL.elasticsearchType).ids(q));
SearchRequestBuilder requestBuilder = client.prepareSearch(INDEX)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH).setQuery(queryBuilder);
if (t.isEmpty()) {
Expand Down

0 comments on commit ea379ab

Please sign in to comment.