I run these queries and here are the number of results I got
// Query 1
machine AND building
{
"query": "machine AND building"
}
// Total 109 items
// Query 2
machine AND car
// Total 27 items
// Query 3. Total 6 items
machine AND building OR car
// Query 4. Total 6 items
building AND machine OR car
// Query 5. Total 6 items
car AND machine OR building
// Query 6. Total 6 items
car OR machine AND building
What we think is that query 3,4,5, 6 should return more matches than query 1,2 but it seems not working like that. We suspect that "term_1 AND term_2 OR term_3" , "term_1 OR term_2 AND term_3" have become "term_1 AND term_2 AND term_3"
The search_explain endpoint (/api/as/v1/engines/ENGINE/search_explain ) showed this
"query": {
"bool": {
"must": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"query_string": {
"query": "machine AND building OR car",
"fields": [
// omitted
]
"minimum_should_match": "1<-1 3<49%",
"phrase_slop": 0
// omitted
How can " AND OR" and " OR AND " become " AND AND " in this case or did we misunderstand something ? How should we change the query to get the expected results ?
Thank you