简体   繁体   中英

Diffrence between output of elastic nested boolean queries

I would like to know if the following two elastic queries would lead to difrent outcomes or same?

 {"bool":{"should":[{"bool":{"must":[{"terms":{"assignee.raw":["AHMEDABAD TEXTILE INDUSTRY'S RESEARCH ASSOCIATION","AHMEDABAD TEXTILE INDUSTRY'S RESERCH ASSOCIATION","AHMEDABAD TEXTILE INDUSTRY?S RESEARCH ASSOCIATION"]}},{"query_string":{"query":"(UNDER EXTENSION ) OR ( INFORCE)","default_operator":"AND","default_field":"legalStatusText"}}]}},{"terms":{"agent.agency.raw":["EPIPHANY IP SOLUTIONS PVT. LTD.","EPIPHANY IP SOLUTIONS PRIVATE LIMITED","EPIPHANY IP SOLUTIONS PVT. LTD"]}}]}}

AND..........

 { "bool": { "should": [ { "bool": { "must": [ { "bool": { "must": [ { "terms": { "assignee.raw": [ "SANJAY BAJAJ", "GTG GMBH" ] } }, { "terms": { "agent.agency.raw": [ "JK STEEL", "ANAND AND ANAND" ] } } ] } }, { "query_string": { "query": "(EXPIRED) OR (APPLICATION WITHDRAWN)", "default_operator": "AND", "default_field": "legalStatusText" } } ] } } ] } }

Basically Does The Extra bool:must in the second snippet makes any difference in the output?

The first query would be (A AND B) OR C

The second query would be ((A AND B) AND C) OR true

So the first and second queries are NOT equivalent because the difference is not about the extra bool/must .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM