ElasticSearch Search Issues

(Nikita Duggal) #1

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 = {

"query": {
    "content":"xyz abc"


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.

(Pranav) #2

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.

(system) #3

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