Class SpanBooleanQueryRewriteWithMaxClause


  • public class SpanBooleanQueryRewriteWithMaxClause
    extends org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod
    A span rewrite method that extracts the first maxExpansions terms that match the MultiTermQuery in the terms dictionary. The rewrite throws an error if more than maxExpansions terms are found and hardLimit is set.
    • Method Summary

      Modifier and Type Method Description
      int getMaxExpansions()  
      boolean isHardLimit()  
      org.apache.lucene.search.spans.SpanQuery rewrite​(org.apache.lucene.index.IndexReader reader, org.apache.lucene.search.MultiTermQuery query)  
      • Methods inherited from class org.apache.lucene.search.MultiTermQuery.RewriteMethod

        getTermsEnum
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SpanBooleanQueryRewriteWithMaxClause

        public SpanBooleanQueryRewriteWithMaxClause()
      • SpanBooleanQueryRewriteWithMaxClause

        public SpanBooleanQueryRewriteWithMaxClause​(int maxExpansions,
                                                    boolean hardLimit)
    • Method Detail

      • getMaxExpansions

        public int getMaxExpansions()
      • isHardLimit

        public boolean isHardLimit()
      • rewrite

        public org.apache.lucene.search.spans.SpanQuery rewrite​(org.apache.lucene.index.IndexReader reader,
                                                                org.apache.lucene.search.MultiTermQuery query)
                                                         throws java.io.IOException
        Specified by:
        rewrite in class org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod
        Throws:
        java.io.IOException