ElasticSearch Search Issues

I am using match phrase query to find in ES. but i have noticed that the results returned are not appropriate. code --

  res = es.search(index=('indice_1'),

           body = {
"_source":["content"],

"query": {
    "match_phrase" 
    "content":"xyz abc"
    }}}

,
size=500,
scroll='60s')

It doesn't get me records where content is - "hi my name isxyz abc." and "hey wassupxyz abc. how is life"

doing a similar search in mongodb using using regex gets both the records as well. Any help would be appreciated.

Match phrase does not work on searches with incomplete terms(words). Either search on "wassupxyz" or only abc. If you want results based on your query only i.e., "xyz abc" use ngram analyzers while indexing. You can also use query string with wildcard.

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