String Comparison is not working


(Rajnikant) #1

When i query for the integer its working properly.
but its not working properly for the string.

//Its Working Fine.
QueryBuilder qb = QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("eventiypeid","123"));

//Its Not Working Fine.
QueryBuilder qb = QueryBuilders.boolQuery()
.must(QueryBuilders.termQuery("eventtypedescription","Ignition"));


(David Pilato) #2

Try to lowercase Ignition.

If it works, you probably are using the default analyzer.


(Rajnikant) #3

Its not working. i used both type of string.


(David Pilato) #4

Can you show your doc and your mapping?


(Rajnikant) #5

Its Working Fine With
MatchQueryBuilder queryBuilder = QueryBuilders.matchQuery("eventtypedescription", "Ignition");

Thanks David


(David Pilato) #6

I'd fix the mapping then instead of lowercasing


(system) #7