Package org.elasticsearch.percolator
Class PercolateQueryBuilder
- java.lang.Object
-
- org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
-
- org.elasticsearch.percolator.PercolateQueryBuilder
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentObject,QueryBuilder,Rewriteable<QueryBuilder>
public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBuilder>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V extends java.lang.Object>, Writeable.Writer<V extends java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME-
Fields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, queryName
-
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description PercolateQueryBuilder(java.lang.String field, java.lang.String indexedDocumentIndex, java.lang.String indexedDocumentType, java.lang.String indexedDocumentId, java.lang.String indexedDocumentRouting, java.lang.String indexedDocumentPreference, java.lang.Long indexedDocumentVersion)Creates a percolator query builder instance for percolating a document in a remote index.PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, java.lang.String indexedDocumentIndex, java.lang.String indexedDocumentType, java.lang.String indexedDocumentId, java.lang.String indexedDocumentRouting, java.lang.String indexedDocumentPreference, java.lang.Long indexedDocumentVersion)Deprecated.PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, java.util.List<BytesReference> documents, XContentType documentXContentType)Deprecated.PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, BytesReference document)Deprecated.usePercolateQueryBuilder(String, BytesReference, XContentType)with the document content type to avoid autodetection.PercolateQueryBuilder(java.lang.String field, java.util.List<BytesReference> documents, XContentType documentXContentType)Creates a percolator query builder instance for percolating a provided document.PercolateQueryBuilder(java.lang.String field, BytesReference document, XContentType documentXContentType)Creates a percolator query builder instance for percolating a provided document.
-
Method Summary
Modifier and Type Method Description protected booleandoEquals(PercolateQueryBuilder other)protected intdoHashCode()protected QueryBuilderdoRewrite(QueryRewriteContext queryShardContext)protected QuerydoToQuery(QueryShardContext context)protected voiddoWriteTo(StreamOutput out)protected voiddoXContent(XContentBuilder builder, ToXContent.Params params)static PercolateQueryBuilderfromXContent(XContentParser parser)java.util.List<BytesReference>getDocuments()java.lang.StringgetDocumentType()java.lang.StringgetField()java.lang.StringgetWriteableName()PercolateQueryBuildersetName(java.lang.String name)Sets the name used for identification purposes in_percolator_document_slotresponse field when multiple percolate queries have been specified in the main query.-
Methods inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
addValidationError, boost, boost, checkNegativeBoost, declareStandardFields, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toQuery, toString, toXContent, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PercolateQueryBuilder
@Deprecated public PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, BytesReference document)Deprecated.usePercolateQueryBuilder(String, BytesReference, XContentType)with the document content type to avoid autodetection.
-
PercolateQueryBuilder
public PercolateQueryBuilder(java.lang.String field, BytesReference document, XContentType documentXContentType)Creates a percolator query builder instance for percolating a provided document.- Parameters:
field- The field that contains the percolator querydocument- The binary blob containing document to percolatedocumentXContentType- The content type of the binary blob containing the document to percolate
-
PercolateQueryBuilder
public PercolateQueryBuilder(java.lang.String field, java.util.List<BytesReference> documents, XContentType documentXContentType)Creates a percolator query builder instance for percolating a provided document.- Parameters:
field- The field that contains the percolator querydocuments- The binary blob containing document to percolatedocumentXContentType- The content type of the binary blob containing the document to percolate
-
PercolateQueryBuilder
@Deprecated public PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, java.util.List<BytesReference> documents, XContentType documentXContentType)Deprecated.
-
PercolateQueryBuilder
public PercolateQueryBuilder(java.lang.String field, java.lang.String indexedDocumentIndex, java.lang.String indexedDocumentType, java.lang.String indexedDocumentId, java.lang.String indexedDocumentRouting, java.lang.String indexedDocumentPreference, java.lang.Long indexedDocumentVersion)Creates a percolator query builder instance for percolating a document in a remote index.- Parameters:
field- The field that contains the percolator queryindexedDocumentIndex- The index containing the document to percolateindexedDocumentType- The type containing the document to percolateindexedDocumentId- The id of the document to percolateindexedDocumentRouting- The routing value for the document to percolateindexedDocumentPreference- The preference to use when fetching the document to percolateindexedDocumentVersion- The expected version of the document to percolate
-
PercolateQueryBuilder
@Deprecated public PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, java.lang.String indexedDocumentIndex, java.lang.String indexedDocumentType, java.lang.String indexedDocumentId, java.lang.String indexedDocumentRouting, java.lang.String indexedDocumentPreference, java.lang.Long indexedDocumentVersion)Deprecated.
-
-
Method Detail
-
setName
public PercolateQueryBuilder setName(java.lang.String name)
Sets the name used for identification purposes in_percolator_document_slotresponse field when multiple percolate queries have been specified in the main query.
-
doWriteTo
protected void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteToin classAbstractQueryBuilder<PercolateQueryBuilder>- Throws:
java.io.IOException
-
doXContent
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
doXContentin classAbstractQueryBuilder<PercolateQueryBuilder>- Throws:
java.io.IOException
-
fromXContent
public static PercolateQueryBuilder fromXContent(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
doEquals
protected boolean doEquals(PercolateQueryBuilder other)
- Specified by:
doEqualsin classAbstractQueryBuilder<PercolateQueryBuilder>
-
doHashCode
protected int doHashCode()
- Specified by:
doHashCodein classAbstractQueryBuilder<PercolateQueryBuilder>
-
getWriteableName
public java.lang.String getWriteableName()
-
doRewrite
protected QueryBuilder doRewrite(QueryRewriteContext queryShardContext)
- Overrides:
doRewritein classAbstractQueryBuilder<PercolateQueryBuilder>
-
doToQuery
protected Query doToQuery(QueryShardContext context) throws java.io.IOException
- Specified by:
doToQueryin classAbstractQueryBuilder<PercolateQueryBuilder>- Throws:
java.io.IOException
-
getField
public java.lang.String getField()
-
getDocumentType
public java.lang.String getDocumentType()
-
getDocuments
public java.util.List<BytesReference> getDocuments()
-
-