I finally got it to work but not with a direct method!
This is what I do:
- Create a clean list of words from the source query, by:
- change to lower case
- replacing any special chars and punctuation with space
- remove duplicate words
- Search using normal match with OR operator for the words joined as a string
- Now we will find the best relevant hits in result
- We take those hits one by one and do a word to word search in php (or whatever programming language you use)
- This word search will check for all the words of a document from the hits we just found, and match them with the words in source query; such that all words from hit document should be present in the source query string
This worked for me well enough!
Unless someone has a direct method from elasticsearch query language.