Elasticsearch difference between MUST and SHOULD bool query

What is the difference between MUST and SHOULD bool query in ES?

If I ONLY want results that contain my terms should I then use must ?

I have a query that should only contain certain values, and also no results that has a lower date/timestamp than todays time/date – NOW

Also

Can i use multiple filters inside a must like the code bellow:

"filtered": {
"filter": {
"bool" : {
        "must" : {
            "term" : { "type" : 1 }
            "term" : { "totals" : 14 }
            "term" : { "groupId" : 3 }
            "range" : {
                "expires" : {
                    "gte": "now"
                }
            }
        },

3 Answers
3

Leave a Comment