forked from elastic/elasticsearch
    
        
        - 
                Notifications
    
You must be signed in to change notification settings  - Fork 0
 
Filtered Query
        kimchy edited this page Feb 4, 2011 
        ·
        1 revision
      
    A query that applies a filter to the results of another query. This query maps to Lucene FilteredQuery.
{
    "filtered" : {
        "query" : {
            "term" : { "tag" : "wow" }
        },
        "filter" : {
            "range" : {
                "age" : { "from" : 10, "to" : 20 }
            }
        }
    }
}The filter object can hold only filter elements, not queries. Filters can be much faster compared to queries since they don't perform any scoring, especially when they are cached.