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.String
NAME
Fields inherited from class org.elasticsearch.index.query.AbstractQueryBuilder
boost, BOOST_FIELD, DEFAULT_BOOST, queryName
-
Constructor Summary
Constructors Modifier 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.protected
PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, java.util.function.Supplier<BytesReference> documentSupplier)
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 boolean
doEquals(PercolateQueryBuilder other)
protected int
doHashCode()
protected QueryBuilder
doRewrite(QueryRewriteContext queryShardContext)
protected org.apache.lucene.search.Query
doToQuery(QueryShardContext context)
protected void
doWriteTo(StreamOutput out)
protected void
doXContent(XContentBuilder builder, ToXContent.Params params)
static PercolateQueryBuilder
fromXContent(XContentParser parser)
java.util.List<BytesReference>
getDocuments()
java.lang.String
getDocumentType()
java.lang.String
getField()
java.lang.String
getQueryName()
java.lang.String
getWriteableName()
PercolateQueryBuilder
setName(java.lang.String name)
Sets the name used for identification purposes in_percolator_document_slot
response 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
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
-
Constructor Details
-
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
protected PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, java.util.function.Supplier<BytesReference> documentSupplier) -
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 Details
-
setName
Sets the name used for identification purposes in_percolator_document_slot
response field when multiple percolate queries have been specified in the main query. -
doWriteTo
- Specified by:
doWriteTo
in classAbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
java.io.IOException
-
doXContent
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
doXContent
in classAbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
java.io.IOException
-
fromXContent
- Throws:
java.io.IOException
-
doEquals
- Specified by:
doEquals
in classAbstractQueryBuilder<PercolateQueryBuilder>
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classAbstractQueryBuilder<PercolateQueryBuilder>
-
getWriteableName
public java.lang.String getWriteableName() -
doRewrite
- Overrides:
doRewrite
in classAbstractQueryBuilder<PercolateQueryBuilder>
-
doToQuery
protected org.apache.lucene.search.Query doToQuery(QueryShardContext context) throws java.io.IOException- Specified by:
doToQuery
in classAbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
java.io.IOException
-
getField
public java.lang.String getField() -
getDocumentType
public java.lang.String getDocumentType() -
getDocuments
-
getQueryName
public java.lang.String getQueryName()
-