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 } }
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; }
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); }
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); }
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)); }
public SpanQueue(SpanOrQuery outerInstance, int size) : base(size) { this.outerInstance = outerInstance; }