Interface QueryBuilder

    • Method Detail

      • toQuery

        org.apache.lucene.search.Query toQuery​(QueryShardContext context)
                                        throws java.io.IOException
        Converts this QueryBuilder to a lucene Query. Returns null if this query should be ignored in the context of parent queries.
        Parameters:
        context - additional information needed to construct the queries
        Returns:
        the Query or null if this query should be ignored upstream
        Throws:
        java.io.IOException
      • toFilter

        org.apache.lucene.search.Query toFilter​(QueryShardContext context)
                                         throws java.io.IOException
        Converts this QueryBuilder to an unscored lucene Query that acts as a filter. Returns null if this query should be ignored in the context of parent queries.
        Parameters:
        context - additional information needed to construct the queries
        Returns:
        the Query or null if this query should be ignored upstream
        Throws:
        java.io.IOException
      • queryName

        QueryBuilder queryName​(java.lang.String queryName)
        Sets the arbitrary name to be assigned to the query (see named queries). Implementers should return the concrete type of the QueryBuilder so that calls can be chained. This is done automatically when extending AbstractQueryBuilder.
      • queryName

        java.lang.String queryName()
        Returns the arbitrary name assigned to the query (see named queries).
      • boost

        float boost()
        Returns the boost for this query.
      • boost

        QueryBuilder boost​(float boost)
        Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided. Implementers should return the concrete type of the QueryBuilder so that calls can be chained. This is done automatically when extending AbstractQueryBuilder.
      • getName

        java.lang.String getName()
        Returns the name that identifies uniquely the query
      • rewrite

        default QueryBuilder rewrite​(QueryRewriteContext queryShardContext)
                              throws java.io.IOException
        Rewrites this query builder into its primitive form. By default this method return the builder itself. If the builder did not change the identity reference must be returned otherwise the builder will be rewritten infinitely.
        Specified by:
        rewrite in interface Rewriteable<QueryBuilder>
        Throws:
        java.io.IOException