Class TopTermsRewrite<Q extends Query>

    • Constructor Summary

      Constructors 
      Constructor Description
      TopTermsRewrite​(int size)
      Create a TopTermsBooleanQueryRewrite for at most size terms.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addClause​(Q topLevel, Term term, int docCount, float boost)
      Add a MultiTermQuery term to the top-level query
      protected abstract void addClause​(Q topLevel, Term term, int docCount, float boost, TermContext states)  
      boolean equals​(java.lang.Object obj)  
      protected abstract int getMaxSize()
      return the maximum size of the priority queue (for boolean rewrites this is BooleanQuery#getMaxClauseCount).
      int getSize()
      return the maximum priority queue size
      protected abstract Q getTopLevelQuery()
      Return a suitable top-level Query for holding all expanded terms.
      int hashCode()  
      Q rewrite​(IndexReader reader, MultiTermQuery query)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • 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 java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getTopLevelQuery

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

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

        protected abstract void addClause​(Q topLevel,
                                          Term term,
                                          int docCount,
                                          float boost,
                                          TermContext states)
                                   throws java.io.IOException
        Throws:
        java.io.IOException