How to use multiple term filters

Hi, I am using the below DSL query:

{   
   "_source": [
        "title",
        "bench",
        "court",
        "id_",
        "verdict"
    ],
    "size": 10,
    "query": {
    	
        "bool": {
            "must": {
                
                    "multi_match": {
                    	"query": "murder" 
                    ,
                    "fields": [
                        "title",
                        "content"
                    ]
                }
            },
        "filter": {
        	
        "term": {
          "verdict": "alllowed"
       }
        
        },
            "should": {
                "multi_match": {
                    "query": "murder",
                    "fields": [
                        "title.standard^16",
                        "content.standard^2"
                    ]
                }
            }
            
        }
          
    
    },
    "highlight": 
    {
        "fields": {
            "title": {},
            "content": {}
        }
    }
}

Now, I want to use one more term query in addition to the one I already have. How do I do it?

Instead of:

"filter": {
        	
        "term": {
          "verdict": "alllowed"
       }
        
        }

Write:

"filter": [
        	{
        "term": {
          "verdict": "alllowed"
       }},{
        "term": {
          "verdict": "foo"
       }}
        
        ]
1 Like

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