Class TopTermsRewrite<Q extends Query>

    • Constructor Detail

      • TopTermsRewrite

        public TopTermsRewrite​(int size)
        Create a TopTermsBooleanQueryRewrite for at most size terms.

        NOTE: if BooleanQuery.getMaxClauseCount() is smaller than size, then it will be used instead.

    • Method Detail

      • getSize

        public int getSize()
        return the maximum priority queue size
      • getMaxSize

        protected abstract int getMaxSize()
        return the maximum size of the priority queue (for boolean rewrites this is BooleanQuery#getMaxClauseCount).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getTopLevelQuery

        protected abstract Q getTopLevelQuery()
                                       throws IOException
        Return a suitable top-level Query for holding all expanded terms.
        Throws:
        IOException
      • addClause

        protected final void addClause​(Q topLevel,
                                       Term term,
                                       int docCount,
                                       float boost)
                                throws IOException
        Add a MultiTermQuery term to the top-level query
        Throws:
        IOException