Elasticsearch relevency search

my search documents have the value of

Doc 1

{
    "keyword_values": "washbasin"
}

Doc 2

{
    "keyword_values": "wash basin"
}

Doc 3

{
    "keyword_values": "wash and basin"
}

Doc 4

{
    "keyword_values": "wash basin tap"
}

Doc 5

{
    "keyword_values": "washbasin tap"
}

if am searching for wash basin or basin wash or wash and basin i should get the result of Doc 1, Doc 2 & Doc 3.
dont want to fetch the Doc 4 or Doc 5

I have used "operator": "AND" in the match query. but am getting the result of all these.

Guide me with the same.

Hi @Mohan_T

It appears there may be some confusion about how Elasticsearch matches and scores documents. In your case, if the documents share the same terms, it may be difficult to filter as you want. Instead, we can focus on getting relevant results to the top of the list, which can be more useful. Focusing on having the most accurate documents at the forefront of your results may be a more effective approach to meeting your needs.

Am getting the relevant result based on the search term at first, based on the scores, but after I am getting the data is irrelevant to to the search. is there any way to achieve this?

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