@@ -1215,7 +1215,11 @@ public void exitDataString(QueryLangParser.DataStringContext ctx) {
12151215 String string = handleStringComparisonWithPlaceholders (ctx .stringComparison ());
12161216
12171217 setMongoQuery (ctx , null );
1218- setElasticQuery (ctx , buildElasticQuery ("dataSet." + fieldId + ".textValue" , op .getType (), string , not ));
1218+ String attribute = "dataSet." + fieldId + ".fulltextValue" ;
1219+ if (op .getType () == QueryLangParser .EQ || op .getType () == QueryLangParser .NEQ ) {
1220+ attribute += ".keyword" ;
1221+ }
1222+ setElasticQuery (ctx , buildElasticQuery (attribute , op .getType (), string , not ));
12191223 this .searchWithElastic = true ;
12201224 }
12211225
@@ -1226,7 +1230,7 @@ public void exitDataStringList(QueryLangParser.DataStringListContext ctx) {
12261230 List <String > stringList = handleStringListComparison (ctx .inListStringComparison ().stringList ());
12271231
12281232 setMongoQuery (ctx , null );
1229- setElasticQuery (ctx , buildElasticQueryInList ("dataSet." + fieldId + ".textValue " , stringList , not ));
1233+ setElasticQuery (ctx , buildElasticQueryInList ("dataSet." + fieldId + ".fulltextValue " , stringList , not ));
12301234 this .searchWithElastic = true ;
12311235 }
12321236
@@ -1239,7 +1243,7 @@ public void exitDataStringRange(QueryLangParser.DataStringRangeContext ctx) {
12391243 Pair <String , String > leftAndRightStrings = handleInRangeStringComparison (ctx .inRangeStringComparison ().stringRange ());
12401244
12411245 setMongoQuery (ctx , null );
1242- setElasticQuery (ctx , buildElasticQueryInRange ("dataSet." + fieldId + ".textValue " , leftAndRightStrings .getFirst (),
1246+ setElasticQuery (ctx , buildElasticQueryInRange ("dataSet." + fieldId + ".fulltextValue " , leftAndRightStrings .getFirst (),
12431247 leftEndpointOpen , leftAndRightStrings .getSecond (), rightEndpointOpen , not ));
12441248 this .searchWithElastic = true ;
12451249 }
0 commit comments