ElasticSearch edgeNGram
A match
query performs analysis on its given value. By default, "jax"
is being analyzed with standardWithEdgeNGram
, which includes n-gram analysis permuting it into ["ja", "ax"]
, the first of which matches the "ja"
from the analyzed "JACKSON v. FRENKEL"
.
If you don't want this behavior you can specify a different analyzer to match
, using the analyzer
field, for example keyword
:
GET /tests/test/_search{ "query": { "match": { "Name": "jax", "analyzer" : "keyword" } }}
In ES 1.3.2 the below query gave an error
GET /tests/test/_search{ "query": { "match": { "Name": "jax", "analyzer" : "keyword" } }}
Error : query parsed in simplified form, with direct field name, but included more options than just the field name, possibly use its 'options' form, with 'query' element?]; }]status: 400
I fixed the issue as below:
{ "query": { "query_string": { "fields": [ "Name" ], "query": "jax", "analyzer": "simple" } }}