org.elasticsearch.index.query
Class BoolFilterBuilder

java.lang.Object
  extended by org.elasticsearch.index.query.BaseFilterBuilder
      extended by org.elasticsearch.index.query.BoolFilterBuilder
All Implemented Interfaces:
ToXContent, FilterBuilder

public class BoolFilterBuilder
extends BaseFilterBuilder

A filter that matches documents matching boolean combinations of other filters.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.MapParams, ToXContent.Params
 
Field Summary
 
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
 
Constructor Summary
BoolFilterBuilder()
           
 
Method Summary
 BoolFilterBuilder cache(boolean cache)
          Should the filter be cached or not.
 BoolFilterBuilder cacheKey(String cacheKey)
           
protected  void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 BoolFilterBuilder filterName(String filterName)
          Sets the filter name for the filter that can be used when searching for matched_filters per hit.
 BoolFilterBuilder must(FilterBuilder filterBuilder)
          Adds a filter that must appear in the matching documents.
 BoolFilterBuilder mustNot(FilterBuilder filterBuilder)
          Adds a filter that must not appear in the matching documents.
 BoolFilterBuilder should(FilterBuilder filterBuilder)
          Adds a filter that should appear in the matching documents.
 
Methods inherited from class org.elasticsearch.index.query.BaseFilterBuilder
toXContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoolFilterBuilder

public BoolFilterBuilder()
Method Detail

must

public BoolFilterBuilder must(FilterBuilder filterBuilder)
Adds a filter that must appear in the matching documents.


mustNot

public BoolFilterBuilder mustNot(FilterBuilder filterBuilder)
Adds a filter that must not appear in the matching documents.


should

public BoolFilterBuilder should(FilterBuilder filterBuilder)
Adds a filter that should appear in the matching documents. For a boolean filter with no MUST clauses one or more SHOULD clauses must match a document for the BooleanQuery to match.


filterName

public BoolFilterBuilder filterName(String filterName)
Sets the filter name for the filter that can be used when searching for matched_filters per hit.


cache

public BoolFilterBuilder cache(boolean cache)
Should the filter be cached or not. Defaults to false.


cacheKey

public BoolFilterBuilder cacheKey(String cacheKey)

doXContent

protected void doXContent(XContentBuilder builder,
                          ToXContent.Params params)
                   throws IOException
Specified by:
doXContent in class BaseFilterBuilder
Throws:
IOException


Copyright © 2009-2012. All Rights Reserved.