org.elasticsearch.index.query
Class IndicesQueryBuilder

java.lang.Object
  extended by org.elasticsearch.index.query.BaseQueryBuilder
      extended by org.elasticsearch.index.query.IndicesQueryBuilder
All Implemented Interfaces:
ToXContent, QueryBuilder

public class IndicesQueryBuilder
extends BaseQueryBuilder

A query that will execute the wrapped query only for the specified indices, and "match_all" when it does not match those indices (by default).


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
IndicesQueryBuilder(QueryBuilder queryBuilder, String... indices)
           
 
Method Summary
protected  void doXContent(XContentBuilder builder, ToXContent.Params params)
           
 IndicesQueryBuilder noMatchQuery(QueryBuilder noMatchQuery)
          Sets the query to use when it executes on an index that does not match the indices provided.
 IndicesQueryBuilder noMatchQuery(String type)
          Sets the no match query, can either be all or none.
 
Methods inherited from class org.elasticsearch.index.query.BaseQueryBuilder
buildAsBytes, buildAsBytes, toString, toXContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndicesQueryBuilder

public IndicesQueryBuilder(QueryBuilder queryBuilder,
                           String... indices)
Method Detail

noMatchQuery

public IndicesQueryBuilder noMatchQuery(String type)
Sets the no match query, can either be all or none.


noMatchQuery

public IndicesQueryBuilder noMatchQuery(QueryBuilder noMatchQuery)
Sets the query to use when it executes on an index that does not match the indices provided.


doXContent

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


Copyright © 2009-2012. All Rights Reserved.