Package org.elasticsearch.percolator
Class PercolateQueryBuilder
- java.lang.Object
-
- org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
-
- org.elasticsearch.percolator.PercolateQueryBuilder
-
- All Implemented Interfaces:
org.elasticsearch.common.io.stream.NamedWriteable
,org.elasticsearch.common.io.stream.Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,org.elasticsearch.index.query.QueryBuilder
,org.elasticsearch.index.query.Rewriteable<org.elasticsearch.index.query.QueryBuilder>
public class PercolateQueryBuilder extends org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
-
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<org.elasticsearch.common.bytes.BytesReference> documents, org.elasticsearch.common.xcontent.XContentType documentXContentType)
Deprecated.PercolateQueryBuilder(java.lang.String field, java.lang.String documentType, org.elasticsearch.common.bytes.BytesReference document)
Deprecated.usePercolateQueryBuilder(String, BytesReference, XContentType)
with the document content type to avoid autodetection.PercolateQueryBuilder(java.lang.String field, java.util.List<org.elasticsearch.common.bytes.BytesReference> documents, org.elasticsearch.common.xcontent.XContentType documentXContentType)
Creates a percolator query builder instance for percolating a provided document.PercolateQueryBuilder(java.lang.String field, org.elasticsearch.common.bytes.BytesReference document, org.elasticsearch.common.xcontent.XContentType documentXContentType)
Creates a percolator query builder instance for percolating a provided document.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doEquals(PercolateQueryBuilder other)
protected int
doHashCode()
protected org.elasticsearch.index.query.QueryBuilder
doRewrite(org.elasticsearch.index.query.QueryRewriteContext queryShardContext)
protected org.apache.lucene.search.Query
doToQuery(org.elasticsearch.index.query.QueryShardContext context)
protected void
doWriteTo(org.elasticsearch.common.io.stream.StreamOutput out)
protected void
doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
static PercolateQueryBuilder
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
java.util.List<org.elasticsearch.common.bytes.BytesReference>
getDocuments()
java.lang.String
getDocumentType()
java.lang.String
getField()
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, declareStandardFields, equals, extractInnerHitBuilders, getName, hashCode, parseInnerQueryBuilder, printBoostAndQueryName, queryName, queryName, requireValue, rewrite, throwParsingExceptionOnMultipleFields, toFilter, toQuery, toString, toXContent, writeTo
-
-
-
-
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, org.elasticsearch.common.bytes.BytesReference document)
Deprecated.usePercolateQueryBuilder(String, BytesReference, XContentType)
with the document content type to avoid autodetection.
-
PercolateQueryBuilder
public PercolateQueryBuilder(java.lang.String field, org.elasticsearch.common.bytes.BytesReference document, org.elasticsearch.common.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(java.lang.String field, java.util.List<org.elasticsearch.common.bytes.BytesReference> documents, org.elasticsearch.common.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(java.lang.String field, java.lang.String documentType, java.util.List<org.elasticsearch.common.bytes.BytesReference> documents, org.elasticsearch.common.xcontent.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_slot
response field when multiple percolate queries have been specified in the main query.
-
doWriteTo
protected void doWriteTo(org.elasticsearch.common.io.stream.StreamOutput out) throws java.io.IOException
- Specified by:
doWriteTo
in classorg.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
java.io.IOException
-
doXContent
protected void doXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
- Specified by:
doXContent
in classorg.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
java.io.IOException
-
fromXContent
public static PercolateQueryBuilder fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
doEquals
protected boolean doEquals(PercolateQueryBuilder other)
- Specified by:
doEquals
in classorg.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
-
doHashCode
protected int doHashCode()
- Specified by:
doHashCode
in classorg.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
-
getWriteableName
public java.lang.String getWriteableName()
-
doRewrite
protected org.elasticsearch.index.query.QueryBuilder doRewrite(org.elasticsearch.index.query.QueryRewriteContext queryShardContext)
- Overrides:
doRewrite
in classorg.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
-
doToQuery
protected org.apache.lucene.search.Query doToQuery(org.elasticsearch.index.query.QueryShardContext context) throws java.io.IOException
- Specified by:
doToQuery
in classorg.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
- Throws:
java.io.IOException
-
getField
public java.lang.String getField()
-
getDocumentType
public java.lang.String getDocumentType()
-
getDocuments
public java.util.List<org.elasticsearch.common.bytes.BytesReference> getDocuments()
-
-