public override Query VisitTermRangeQuery(TermRangeQuery termRangeq) { var field = termRangeq.GetField(); var lowerTerm = GetTermText(termRangeq.GetLowerTerm()); var upperTerm = GetTermText(termRangeq.GetUpperTerm()); var includesLower = termRangeq.IncludesLower(); var includesUpper = termRangeq.IncludesUpper(); string oneTerm = null; _text.Append(field); _text.Append(":"); string op = null; if (lowerTerm == null) { op = includesUpper ? "<=" : "<"; oneTerm = upperTerm; } if (upperTerm == null) { op = includesLower ? ">=" : ">"; oneTerm = lowerTerm; } if (op == null) { _text.Append(includesLower ? '[' : '{'); _text.Append(lowerTerm); _text.Append(" TO "); _text.Append(upperTerm); _text.Append(includesUpper ? ']' : '}'); } else { _text.Append(op).Append(oneTerm); } _text.Append(BoostToString(termRangeq.GetBoost())); return base.VisitTermRangeQuery(termRangeq); }
/// <summary>Returns the upper term of this range query. </summary> public virtual Term GetUpperTerm() { System.String term = delegate_Renamed.GetUpperTerm(); return((term == null)?null:new Term(GetField(), term)); }
// <V2.9.2> public virtual Query VisitTermRangeQuery(TermRangeQuery termRangeq) { var field = termRangeq.GetField(); var visitedField = VisitField(field); if (field == visitedField) return termRangeq; return new TermRangeQuery(visitedField, termRangeq.GetLowerTerm(), termRangeq.GetUpperTerm(), termRangeq.IncludesLower(), termRangeq.IncludesUpper()); }