/// <summary>Returns true iff <code>o</code> is equal to this. </summary> public override bool Equals(System.Object o) { if (this == o) { return(true); } if (o == null || GetType() != o.GetType()) { return(false); } SpanNearQuery spanNearQuery = (SpanNearQuery)o; if (inOrder != spanNearQuery.inOrder) { return(false); } if (slop != spanNearQuery.slop) { return(false); } if (!clauses.Equals(spanNearQuery.clauses)) { return(false); } if (!field.Equals(spanNearQuery.field)) { return(false); } return(GetBoost() == spanNearQuery.GetBoost()); }
/// <summary>Returns true iff <code>o</code> is equal to this. </summary> public override bool Equals(System.Object o) { if (this == o) { return(true); } if (!(o is SpanNearQuery)) { return(false); } SpanNearQuery spanNearQuery = (SpanNearQuery)o; if (inOrder != spanNearQuery.inOrder) { return(false); } if (slop != spanNearQuery.slop) { return(false); } if (clauses.Count != spanNearQuery.clauses.Count) { return(false); } IEnumerator <SpanQuery> iter1 = clauses.GetEnumerator(); IEnumerator <SpanQuery> iter2 = spanNearQuery.clauses.GetEnumerator(); while (iter1.MoveNext() && iter2.MoveNext()) { SpanQuery item1 = iter1.Current; SpanQuery item2 = iter2.Current; if (!item1.Equals(item2)) { return(false); } } return(GetBoost() == spanNearQuery.GetBoost()); }
private static void GetTermsFromSpanNearQuery(SpanNearQuery query, HashSetSupport terms, string fieldName) { ICollection queryTerms = query.GetTerms(); for (IEnumerator iterator = queryTerms.GetEnumerator(); iterator.MoveNext(); ) { // break it out for debugging. Term term = (Term) iterator.Current; string text = term.Text(); if ((fieldName == null) || (term.Field() == (string)(object)fieldName)) { terms.Add(new WeightedTerm(query.GetBoost(), text)); } } }