Terms vs should


(Soufiane Ghzal) #1

Hi,

I wonder if there is a difference between using multiple value in a "terms" filter and using multiple "term" queries in a should filter.

With example, is there a difference between this query:

{
    "query": {
        "constant_score" : {
            "filter" : {
                "terms" : { "user" : ["kimchy", "elasticsearch"]}
            }
        }
    }
}

and this one:

{
    "query": {
        "constant_score" : {
            "filter" : {
                "bool": {
                    "should" : [
                        { "term" : { "user" : "kimchy" } },
                        { "term" : { "user" : "elasticsearch" } }
                    ]
                }
            }
        }
    }
}

Thanks


(system) #2

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