Elasticsearch analyser only being used when I specify the field of the search

StackOverflow https://stackoverflow.com/questions/14320669

  •  15-01-2022
  •  | 
  •  

Вопрос

I have an analyser called autocomplete_analyser defined on a field name. When I run the query

http://localhost:9200/courses/course/_search?q=name:dav&pretty=true

it runs the analyser and returns the correct results. When I run

http://localhost:9200/courses/course/_search?q=dav&pretty=true

it does not.

How can I make ES run the analyser without me specifying the fields being searched on? I need to use this analyser across a number of fields so its important that I can search all of them.

Это было полезно?

Решение

By default, queryString queries are applied on _all field which have its own analyzer.

You can define your specific analyzer for the _all field using the Put Mapping API.

Does it help?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top