String Comparison is not working

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"));

Try to lowercase Ignition.

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

Its not working. i used both type of string.

Can you show your doc and your mapping?

1 Like

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

Thanks David

I'd fix the mapping then instead of lowercasing

1 Like