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>
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    org.elasticsearch.common.io.stream.Writeable.Reader<V extends java.lang.Object>, org.elasticsearch.common.io.stream.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

    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
    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<org.elasticsearch.common.bytes.BytesReference> documentSupplier)  
      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.
    use PercolateQueryBuilder(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

    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 queryRewriteContext)  
    protected org.apache.lucene.search.Query doToQuery​(org.elasticsearch.index.query.SearchExecutionContext 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 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, 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 Details

  • Constructor Details

    • PercolateQueryBuilder

      @Deprecated public PercolateQueryBuilder​(java.lang.String field, java.lang.String documentType, org.elasticsearch.common.bytes.BytesReference document)
      Deprecated.
      use PercolateQueryBuilder(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 query
      document - The binary blob containing document to percolate
      documentXContentType - 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 query
      documents - The binary blob containing document to percolate
      documentXContentType - 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

      protected PercolateQueryBuilder​(java.lang.String field, java.lang.String documentType, java.util.function.Supplier<org.elasticsearch.common.bytes.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 query
      indexedDocumentIndex - The index containing the document to percolate
      indexedDocumentType - The type containing the document to percolate
      indexedDocumentId - The id of the document to percolate
      indexedDocumentRouting - The routing value for the document to percolate
      indexedDocumentPreference - The preference to use when fetching the document to percolate
      indexedDocumentVersion - 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

      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 class org.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 class org.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 class org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
    • doHashCode

      protected int doHashCode()
      Specified by:
      doHashCode in class org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
    • getWriteableName

      public java.lang.String getWriteableName()
    • doRewrite

      protected org.elasticsearch.index.query.QueryBuilder doRewrite​(org.elasticsearch.index.query.QueryRewriteContext queryRewriteContext)
      Overrides:
      doRewrite in class org.elasticsearch.index.query.AbstractQueryBuilder<PercolateQueryBuilder>
    • doToQuery

      protected org.apache.lucene.search.Query doToQuery​(org.elasticsearch.index.query.SearchExecutionContext context) throws java.io.IOException
      Specified by:
      doToQuery in class org.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()
    • getQueryName

      public java.lang.String getQueryName()