Exemplo n.º 1
0
        /// <summary>
        /// Rewrites the query. If the wrapped is an instance of
        /// <see cref="MatchAllDocsQuery"/> it returns a <see cref="ConstantScoreQuery"/>. Otherwise
        /// it returns a new <see cref="FilteredQuery"/> wrapping the rewritten query.
        /// </summary>
        public override Query Rewrite(IndexReader reader)
        {
            Query queryRewritten = query.Rewrite(reader);

            if (queryRewritten != query)
            {
                // rewrite to a new FilteredQuery wrapping the rewritten query
                Query rewritten = new FilteredQuery(queryRewritten, filter, strategy);
                rewritten.Boost = this.Boost;
                return(rewritten);
            }
            else
            {
                // nothing to rewrite, we are done!
                return(this);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if <paramref name="o"/> is equal to this. </summary>
        public override bool Equals(object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!base.Equals(o))
            {
                return(false);
            }
            if (Debugging.AssertsEnabled)
            {
                Debugging.Assert(o is FilteredQuery);
            }
            FilteredQuery fq = (FilteredQuery)o;

            return(fq.query.Equals(this.query) && fq.filter.Equals(this.filter) && fq.strategy.Equals(this.strategy));
        }
Exemplo n.º 3
0
 public WeightAnonymousInnerClassHelper(FilteredQuery outerInstance, Lucene.Net.Search.Weight weight)
 {
     this.outerInstance = outerInstance;
     this.weight        = weight;
 }
Exemplo n.º 4
0
 public WeightAnonymousClass(FilteredQuery outerInstance, Weight weight)
 {
     this.outerInstance = outerInstance;
     this.weight        = weight;
 }
Exemplo n.º 5
0
 public WeightAnonymousInnerClassHelper(FilteredQuery outerInstance, Weight weight)
 {
     this.outerInstance = outerInstance;
     this.weight        = weight;
 }