Rexexp query with filtering

Hi,
i have this json for a query :
"query": {
"regexp": {
"errors.message": ".cannotdefinehostportsexception."
}
i get ~2000 hits and i'd like to filter with range on one of the fields.
is there a way i can use filtering on a regexp result ?

Thanks
Sivan

Have a look at bool queries.

Thanks, i did try it before your suggestion but couldn't get the right syntax.
you helped me understand that is indeed the right way.

if someone needs a working solution, here is what i did:

"query": {
            "bool": {
                "must": {
                      "regexp": {<field>: <regexp>}
                },
                "filter": [{
                      "range": {
                           <field>: {"gte": 1}
                        }
                 }],
            }
}

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