From c420e405661eb95fc59d08ef5984f239de245ef0 Mon Sep 17 00:00:00 2001 From: RDBloese <38698852+RDBloese@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:32:10 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84nderungen=20f=C3=BCr=20TokenSearch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tla/backend/es/query/TokenSearchQueryBuilder.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/tla/backend/es/query/TokenSearchQueryBuilder.java b/src/main/java/tla/backend/es/query/TokenSearchQueryBuilder.java index ecc43e44..827c2a51 100644 --- a/src/main/java/tla/backend/es/query/TokenSearchQueryBuilder.java +++ b/src/main/java/tla/backend/es/query/TokenSearchQueryBuilder.java @@ -10,6 +10,17 @@ public class TokenSearchQueryBuilder extends ESQueryBuilder implements MultiLing public String nestedPath() { return "tokens."; } + + public void setTokenID(String tokenID) { + if (tokenID != null) { + this.must( + QueryBuilders.termQuery( + String.format("%sid", this.nestedPath()), + tokenID + ) + ); + } + } public void setLemma(Lemmatization lemma) { if (lemma != null && !lemma.isEmpty()) {