Closed jappievw closed 4 years ago
Interesting, thanks for the fix. This actually looks like a bug in Elasticsearch itself, I'm going to open an issue over there to see if they can fix the underlying issue. Until then, your patch will work great.
Thanks!
Yeap, it's inconsistent behaviour. I think it's caused by the fact that the multi_field property type has been added in a later release. A design goal was to make it fully backwards compatible, which is what they achieved with allowing brand
instead of requiring brand.brand
.
When a multi-field property has a field with the same name, inquisitor just proposes to use the
field.field
to test analyzers. However, ElasticSearch then falls back to the default analyzer.Please consider this example:
Inquisitor suggests to test the analyzer by using the following request:
curl -XPOST "http://127.0.0.1:9200/test_multifield_same_name/_analyze?pretty=true&field=brand.brand" -d 'This Is Just A Test With Capitalized Words'
. This results in the standard analyzer to be used. The result is:In order to test the analyzer for this
brand
field, Elasticsearch expects to test it like this:curl -XPOST "http://127.0.0.1:9200/test_multifield_same_name/_analyze?pretty=true&field=brand" -d 'This Is Just A Test With Capitalized Words'
. This in fact results in the whitespace analyzer to be applied. The output is:The question is: when the property and the field name have exactly the same name, can you suggest it with just the property name?