I have a query that looks like the following
functions: [...],
query: {
bool: {
must: [ ],
must_not: [ ],
should: [ ],
filter: [ ],
},
},
I want to limit search to when username = "demo" or isPublic = 1
Initially I was using should for this:
should: [
term: {username: "demo"},
term: {isPublic: 1}
]
I quickly ran into some issues. I realized that should was simply improving scores for the results instead of restricting result? Which means entries with username = "demo" AND isPublic are ranked way higher. This is not what I want. I just want entries to fulfill these criteria.
A way would be to have something like must [username: "demo" OR isPublic: 1]
, but I can't seem to find something like this in the documentation.