Skip to content

Commit

Permalink
Fixed ES queries
Browse files Browse the repository at this point in the history
  • Loading branch information
EinsamHauer committed Oct 19, 2022
1 parent b961135 commit 49739bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.iponweb.disthene.reader</groupId>
<artifactId>disthene-reader</artifactId>
<packaging>jar</packaging>
<version>2.0.12</version>
<version>2.0.13</version>
<name>disthene-reader</name>
<url>https://maven.apache.org</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private List<String> getPathsFromRegExs(String tenant, List<String> regExs, bool
String regEx = Joiner.on("|").skipNulls().join(regExs);

BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery()
.must(QueryBuilders.regexpQuery("path", regEx))
.must(QueryBuilders.regexpQuery("path.keyword", regEx))
.filter(QueryBuilders.termQuery("tenant.keyword", tenant));

if (leaf) queryBuilder.filter(QueryBuilders.termQuery("leaf", true));
Expand Down Expand Up @@ -141,7 +141,7 @@ public String getPathsAsJsonArray(String tenant, String wildcard) throws TooMuch
}

BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery()
.must(QueryBuilders.regexpQuery("path", regEx))
.must(QueryBuilders.regexpQuery("path.keyword", regEx))
.filter(QueryBuilders.termQuery("tenant.keyword", tenant));

SearchSourceBuilder sourceBuilder = new SearchSourceBuilder()
Expand Down Expand Up @@ -202,7 +202,7 @@ public String getPathsWithStats(String tenant, String wildcard) throws TooMuchDa

CountRequest countRequest = new CountRequest(indexConfiguration.getIndex())
.query(QueryBuilders.boolQuery()
.must(QueryBuilders.regexpQuery("path", path + "\\..*"))
.must(QueryBuilders.regexpQuery("path.keyword", path + "\\..*"))
.must(QueryBuilders.termQuery("tenant.keyword", tenant))
.must(QueryBuilders.termQuery("leaf", true)));

Expand Down

0 comments on commit 49739bc

Please sign in to comment.