コード例 #1
0
 public override Query Rewrite(IndexReader reader)
 {
     if (m_query != null)
     {
         Query rewritten = m_query.Rewrite(reader);
         if (rewritten != m_query)
         {
             rewritten       = new ConstantScoreQuery(rewritten);
             rewritten.Boost = this.Boost;
             return(rewritten);
         }
     }
     else
     {
         Debug.Assert(m_filter != null);
         // Fix outdated usage pattern from Lucene 2.x/early-3.x:
         // because ConstantScoreQuery only accepted filters,
         // QueryWrapperFilter was used to wrap queries.
         if (m_filter is QueryWrapperFilter)
         {
             QueryWrapperFilter qwf = (QueryWrapperFilter)m_filter;
             Query rewritten        = new ConstantScoreQuery(qwf.Query.Rewrite(reader));
             rewritten.Boost = this.Boost;
             return(rewritten);
         }
     }
     return(this);
 }
コード例 #2
0
 public DocIdSetAnonymousInnerClassHelper(QueryWrapperFilter outerInstance, IBits acceptDocs, AtomicReaderContext privateContext, Lucene.Net.Search.Weight weight)
 {
     this.outerInstance  = outerInstance;
     this.acceptDocs     = acceptDocs;
     this.privateContext = privateContext;
     this.weight         = weight;
 }