Class CompletionQuery

    • Field Detail

      • term

        private final Term term
        Term to query against
    • Constructor Detail

      • CompletionQuery

        protected CompletionQuery​(Term term,
                                  BitsProducer filter)
        Creates a base Completion query against a term with a filter to scope the documents
    • Method Detail

      • getFilter

        public BitsProducer getFilter()
        Returns a BitsProducer. Only suggestions matching the returned bits will be returned.
      • getField

        public java.lang.String getField()
        Returns the field name this query should be run against
      • getTerm

        public Term getTerm()
        Returns the term to be queried against
      • rewrite

        public Query rewrite​(IndexSearcher indexSearcher)
                      throws java.io.IOException
        Description copied from class: Query
        Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.

        Callers are expected to call rewrite multiple times if necessary, until the rewritten query is the same as the original query.

        The rewrite process may be able to make use of IndexSearcher's executor and be executed in parallel if the executor is provided.

        However, if any of the intermediary queries do not satisfy the new API, parallel rewrite is not possible for any subsequent sub-queries. To take advantage of this API, the entire query tree must override this method.

        Overrides:
        rewrite in class Query
        Throws:
        java.io.IOException
        See Also:
        IndexSearcher.rewrite(Query)
      • toString

        public java.lang.String toString​(java.lang.String field)
        Description copied from class: Query
        Prints a query to a string, with field assumed to be the default field and omitted.
        Specified by:
        toString in class Query
      • validate

        private void validate​(java.lang.String termText)