示例#1
0
        public override Query Rewrite(IndexReader reader)
        {
            SpanOrQuery clone = null;

            for (int i = 0; i < clauses.Count; i++)
            {
                SpanQuery c     = clauses[i];
                SpanQuery query = (SpanQuery)c.Rewrite(reader);
                if (query != c) // clause rewrote: must clone
                {
                    if (clone == null)
                    {
                        clone = (SpanOrQuery)this.Clone();
                    }
                    clone.clauses[i] = query;
                }
            }
            if (clone != null)
            {
                return(clone); // some clauses rewrote
            }
            else
            {
                return(this); // no clauses rewrote
            }
        }
示例#2
0
 public SpansAnonymousInnerClassHelper(SpanOrQuery outerInstance, AtomicReaderContext context, IBits acceptDocs, IDictionary <Term, TermContext> termContexts)
 {
     this.outerInstance = outerInstance;
     this.context       = context;
     this.acceptDocs    = acceptDocs;
     this.termContexts  = termContexts;
     queue = null;
 }
示例#3
0
        public override object Clone()
        {
            int sz = clauses.Count;

            SpanQuery[] newClauses = new SpanQuery[sz];

            for (int i = 0; i < sz; i++)
            {
                newClauses[i] = (SpanQuery)clauses[i].Clone();
            }
            SpanOrQuery soq = new SpanOrQuery(newClauses);

            soq.Boost = Boost;
            return(soq);
        }
示例#4
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || this.GetType() != o.GetType())
            {
                return(false);
            }

            SpanOrQuery that = (SpanOrQuery)o;

            if (!clauses.Equals(that.clauses))
            {
                return(false);
            }

            return(Boost == that.Boost);
        }
示例#5
0
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }
            if (o == null || this.GetType() != o.GetType())
            {
                return(false);
            }

            SpanOrQuery that = (SpanOrQuery)o;

            if (!clauses.Equals(that.clauses))
            {
                return(false);
            }

            // LUCENENET specific - compare bits rather than using equality operators to prevent these comparisons from failing in x86 in .NET Framework with optimizations enabled
            return(NumericUtils.SingleToSortableInt32(Boost) == NumericUtils.SingleToSortableInt32(that.Boost));
        }
示例#6
0
 public SpanQueue(SpanOrQuery outerInstance, int size)
     : base(size)
 {
     this.outerInstance = outerInstance;
 }