Filter (RANGE) on different fields in elasticsearch

Hello people,

I'm a beginner in elasticsarch and I wanted this query below to work with two RANGE filters in different fields, but only the first RANGE is working.

This filter below is working normally:

"range" : {"pgrk" : { "gte" : 1, "lte" : 10} }

Could someone tell me why this second filter below doesn't work?

"should" : {
"range" : {"url_length" : { "gte" : 50, "lte" : 100 } }

--------------------------Follow my query below with the two filters--------------------------

{

    "from" : 0, "size" : 10,

    "sort" : [
            { "pgrk" : {"order" : "desc"} },

             { "url_length" : {"order" : "asc"} }
        ],

        "query": {

    "bool": {
    "must": {

    "multi_match" : {
    "query": "netflix",

    "type": "cross_fields",
    "fields": [ "titulo", "descricao", "url" ],
    "operator": "and"
            }
         },
         "filter": {
         "range" : {"pgrk" : { "gte" : 1, "lte" : 10 } }
          },


    "should" : {
            "range" : {"url_length" : { "gte" : 50, "lte" : 100 } }
            }

            }
    }


          }

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