Package org.elasticsearch.percolator
Class PercolateQueryBuilder
java.lang.Object
org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
org.elasticsearch.percolator.PercolateQueryBuilder
- All Implemented Interfaces:
NamedWriteable
,Writeable
,QueryBuilder
,Rewriteable<QueryBuilder>
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V extends Object>, Writeable.Writer<V extends Object>
-
Field Summary
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.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionPercolateQueryBuilder
(String field, String indexedDocumentIndex, String indexedDocumentType, String indexedDocumentId, String indexedDocumentRouting, String indexedDocumentPreference, Long indexedDocumentVersion) Creates a percolator query builder instance for percolating a document in a remote index.PercolateQueryBuilder
(String field, String documentType, String indexedDocumentIndex, String indexedDocumentType, String indexedDocumentId, String indexedDocumentRouting, String indexedDocumentPreference, Long indexedDocumentVersion) Deprecated.protected
PercolateQueryBuilder
(String field, String documentType, Supplier<BytesReference> documentSupplier) PercolateQueryBuilder
(String field, String documentType, List<BytesReference> documents, org.elasticsearch.xcontent.XContentType documentXContentType) Deprecated.PercolateQueryBuilder
(String field, String documentType, BytesReference document) Deprecated.PercolateQueryBuilder
(String field, List<BytesReference> documents, org.elasticsearch.xcontent.XContentType documentXContentType) Creates a percolator query builder instance for percolating a provided document.PercolateQueryBuilder
(String field, BytesReference document, org.elasticsearch.xcontent.XContentType documentXContentType) Creates a percolator query builder instance for percolating a provided document. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doEquals
(PercolateQueryBuilder other) protected int
protected QueryBuilder
doRewrite
(QueryRewriteContext queryRewriteContext) protected org.apache.lucene.search.Query
doToQuery
(SearchExecutionContext context) protected void
doWriteTo
(StreamOutput out) protected void
doXContent
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) static PercolateQueryBuilder
fromXContent
(org.elasticsearch.xcontent.XContentParser parser) getField()
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, 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.xcontent.ToXContentObject
isFragment
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
PercolateQueryBuilder
@Deprecated public PercolateQueryBuilder(String field, String documentType, BytesReference document) Deprecated.usePercolateQueryBuilder(String, BytesReference, XContentType)
with the document content type to avoid autodetection. -
PercolateQueryBuilder
public PercolateQueryBuilder(String field, BytesReference document, org.elasticsearch.xcontent.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(String field, List<BytesReference> documents, org.elasticsearch.xcontent.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(String field, String documentType, List<BytesReference> documents, org.elasticsearch.xcontent.XContentType documentXContentType) Deprecated. -
PercolateQueryBuilder
protected PercolateQueryBuilder(String field, String documentType, Supplier<BytesReference> documentSupplier) -
PercolateQueryBuilder
public PercolateQueryBuilder(String field, String indexedDocumentIndex, String indexedDocumentType, String indexedDocumentId, String indexedDocumentRouting, String indexedDocumentPreference, 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(String field, String documentType, String indexedDocumentIndex, String indexedDocumentType, String indexedDocumentId, String indexedDocumentRouting, String indexedDocumentPreference, 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:
IOException
-
doXContent
protected void doXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
doXContent
in classAbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
IOException
-
fromXContent
public static PercolateQueryBuilder fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
doEquals
- Specified by:
doEquals
in classAbstractQueryBuilder<PercolateQueryBuilder>
-
doHashCode
protected int doHashCode()- Specified by:
doHashCode
in classAbstractQueryBuilder<PercolateQueryBuilder>
-
getWriteableName
-
doRewrite
- Overrides:
doRewrite
in classAbstractQueryBuilder<PercolateQueryBuilder>
-
doToQuery
protected org.apache.lucene.search.Query doToQuery(SearchExecutionContext context) throws IOException - Specified by:
doToQuery
in classAbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
IOException
-
getField
-
getDocumentType
-
getDocuments
-
getQueryName
-
PercolateQueryBuilder(String, BytesReference, XContentType)
with the document content type to avoid autodetection.