public virtual void AddSpanQueries(SpanNearClauseFactory sncf) { VisitMatchingTerms( sncf.IndexReader, sncf.FieldName, new AddSpanQueriesMatchingTermVisitor(sncf, Weight)); }
public virtual Search.Query GetSpanNearQuery( IndexReader reader, string fieldName, float boost, BasicQueryFactory qf) { SpanQuery[] spanClauses = new SpanQuery[NrSubQueries]; var sqi = GetSubQueriesEnumerator(); int qi = 0; while (sqi.MoveNext()) { SpanNearClauseFactory sncf = new SpanNearClauseFactory(reader, fieldName, qf); ((IDistanceSubQuery)sqi.Current).AddSpanQueries(sncf); if (sncf.Count == 0) { /* distance operator requires all sub queries */ while (sqi.MoveNext()) { /* produce evt. error messages but ignore results */ ((IDistanceSubQuery)sqi.Current).AddSpanQueries(sncf); sncf.Clear(); } return(SrndQuery.TheEmptyLcnQuery); } spanClauses[qi] = sncf.MakeSpanClause(); qi++; } SpanNearQuery r = new SpanNearQuery(spanClauses, OpDistance - 1, QueriesOrdered); r.Boost = boost; return(r); }
public virtual void AddSpanQueries(SpanNearClauseFactory sncf) { var sqi = GetSubQueriesEnumerator(); while (sqi.MoveNext()) { ((IDistanceSubQuery)sqi.Current).AddSpanQueries(sncf); } }
public virtual void AddSpanQueries(SpanNearClauseFactory sncf) { Search.Query snq = GetSpanNearQuery(sncf.IndexReader, sncf.FieldName, Weight, sncf.BasicQueryFactory); sncf.AddSpanQuery(snq); }
public AddSpanQueriesMatchingTermVisitor(SpanNearClauseFactory sncf, float weight) { this.sncf = sncf; this.weight = weight; }
public virtual Search.Query GetSpanNearQuery( IndexReader reader, string fieldName, float boost, BasicQueryFactory qf) { SpanQuery[] spanClauses = new SpanQuery[NrSubQueries]; var sqi = GetSubQueriesEnumerator(); int qi = 0; while (sqi.MoveNext()) { SpanNearClauseFactory sncf = new SpanNearClauseFactory(reader, fieldName, qf); ((IDistanceSubQuery)sqi.Current).AddSpanQueries(sncf); if (sncf.Count == 0) { /* distance operator requires all sub queries */ while (sqi.MoveNext()) { /* produce evt. error messages but ignore results */ ((IDistanceSubQuery)sqi.Current).AddSpanQueries(sncf); sncf.Clear(); } return SrndQuery.TheEmptyLcnQuery; } spanClauses[qi] = sncf.MakeSpanClause(); qi++; } SpanNearQuery r = new SpanNearQuery(spanClauses, OpDistance - 1, QueriesOrdered); r.Boost = boost; return r; }