My Requirement is If Match happend then I don't want check remaining match cases of Query because of it will decrease search performance


(Sekhar) #1

Query : {"query":{"bool":{"should":[{"match":{"4":{"query":"kavana","_name":"4.WordMatch"}}},{"match":{"4.exactMatch":{"query":"kavana","_name":"4.exactMatch"}}}],"minimum_should_match":1}}}

Output of Match Cases:

"matched_queries": ["4.WordMatch", "4.exactMatch"]

My Requirement is If Match happend then I don't want check remaining match cases of Query because of it will decrease search performance but it will increase documents count. Think as Should as IF condition and match case as Condition .Suppose each Condition between OR mean if First condition true mean it will entry into IF condition or checking remaining condition.Same behaviour I am Expecting

Sample Query :

{"query":{"bool":{"should":[{"match":{"4":{"query":"kavana","_name":"4.WordMatch"}}},{"match":{"4.exactMatch":{"query":"kavana","_name":"4.exactMatch"}}}],"minimum_should_match":1}}}

Sample OutOut :

"matched_queries": ["4.WordMatch"]

or
"matched_queries": ["4.exactMatch"]


(Mark Walkom) #2

There's no way to do this that would make sense, it needs to query multiple documents to find out the relevant documents and then find the one that is most relevant.

What exactly do you want this for?


(Sekhar) #3

I want to terminate search query if match query matched happend on should.

Example : If(condition1 ||condition2 || condition3 || condition4)
explaination: condition1 is true then it will entry into if block.It will not check remaining condition 2 to condition 4

should(match1 || match2 || match3 || match4)
Explaination : match1 query matched mean I don't want check remaining match cases.

I don't want more document's .I want know match happend or not.that it


(system) #4

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