TermFilter and TermQuery is not Working with not analysed field


I am using elasticsearch1.7.2 version,
The signature field which i am storing is not_analyzed while index creation is as follows
Column name is : signature
"signature" : { "type" : "string","index" : "not_analyzed","fielddata": {"format": "doc_values"}}
In the column the value is stored seems
String signature="PROTOCOL-DNS TMG Firewall Client long host entry exploit attempt "

I am trying to fetch the signature value using the following options as follows

It wont give the results using above,

The only way i am geeting the results with the following approach,

Is i did anything wrong with the above query formation.Please suggest.


term queries should work fine for analyzed fields. If wildcards work with surrounding +s maybe you have leading or trailing stuff in the signature? Like a trailing white space or something.

Hi Nik,


You are right ,Some strings have a trailing spaces which cause the result.

Is there any possible to check against whitespaces in the queries.
For not analysed fields which queries are the opt ?

Thanks Again


Found like a another one, I am storing the value is like "PROTOCOL-DNS TMG Firewall Client long host entry exploit attempt" in analysed filed.

When i am queried to the particular field in term query with the exact value , I am not getting the results.

But if i am passed the values by lowercase it's returns the result,
i have to pass lowercase always or any other alternatives.