Difference between matchquery and matchphrase query

I need to know the difference between matchquery and match phrase query if i use them to search for text "92%". Would i able to get exact match for this text using match query or match phrase query.

A match query looks for the existence of a token in a field, whereas a match_phrase query looks for the existence of a sequence of tokens (a phrase) in the field.

Both work on the results of the analysis performed during indexing and searching. The standard analyser will remove the percentage sign from the token, so both won't return any results.

A better approach might be to store just the numerical value (as 92, or 0.92) into field mapped with one of the numerical datatypes, on which aggregations or range searches can be performed.

I am using following property during mapping:
"type", "string"
"index", "not_analyzed".

I have used term query,match query and match phrase query to search for value 92% but we are not able to get any response from elastic search.
Even term query doesn't providing any value for exact match.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.