Skip to content

Commit

Permalink
Fix compile error after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
afoucret committed Oct 25, 2024
1 parent fc6c3e5 commit 321e55f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import static org.elasticsearch.xpack.kql.parser.KqlParserExecutionContext.isDateField;
import static org.elasticsearch.xpack.kql.parser.KqlParserExecutionContext.isKeywordField;
import static org.elasticsearch.xpack.kql.parser.KqlParserExecutionContext.isRuntimeField;
import static org.elasticsearch.xpack.kql.parser.ParserUtils.escapeQueryString;
import static org.elasticsearch.xpack.kql.parser.ParserUtils.escapeLuceneQueryString;
import static org.elasticsearch.xpack.kql.parser.ParserUtils.hasWildcard;

class KqlAstBuilder extends KqlBaseBaseVisitor<QueryBuilder> {
Expand Down Expand Up @@ -139,7 +139,7 @@ public QueryBuilder visitFieldLessQuery(KqlBaseParser.FieldLessQueryContext ctx)

if (hasWildcard(ctx.fieldQueryValue())) {
// TODO: set default fields.
return QueryBuilders.queryStringQuery(escapeQueryString(queryText, true));
return QueryBuilders.queryStringQuery(escapeLuceneQueryString(queryText, true));
}

boolean isPhraseMatch = ctx.fieldQueryValue().QUOTED_STRING() != null;
Expand All @@ -164,7 +164,7 @@ public QueryBuilder visitFieldQuery(KqlBaseParser.FieldQueryContext ctx) {
fieldQuery = QueryBuilders.wildcardQuery(fieldName, queryText)
.caseInsensitive(kqlParserExecutionContext.isCaseSensitive() == false);
} else if (hasWildcard) {
fieldQuery = QueryBuilders.queryStringQuery(escapeQueryString(queryText, true)).field(fieldName);
fieldQuery = QueryBuilders.queryStringQuery(escapeLuceneQueryString(queryText, true)).field(fieldName);
} else if (isDateField(mappedFieldType)) {
// TODO: add timezone
fieldQuery = QueryBuilders.rangeQuery(fieldName).gte(queryText).lte(queryText);
Expand Down

0 comments on commit 321e55f

Please sign in to comment.