Searching text with white space


(Ken) #1

Hi all,
I am quiet new to ElasticSearch and i am facing this issue so hopefully I can find the answer here.
I am searching the full name such as "John Smith" and i expected ElasticSearch to return the documents that containing the string "John Smith" but now ElasticSearch returned to me the documents containing either "John" or "Smith". Is there any way to force ElasticSearch to return the result of "John Smith".

Thanks.


(David Pilato) #2

Depends on the query you are using.

With query string query you can change default_operator to AND. See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html


(system) #3

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