dsmiley commented on a change in pull request #357: [SOLR-12238] Synonym
Queries boost by payload
URL: https://github.com/apache/lucene-solr/pull/357#discussion_r376455962
##########
File path: lucene/core/src/java/org/apache/lucene/util/QueryBuilder.java
##########
@@ -509,33 +549,40 @@ protected Query analyzeGraphBoolean(String field,
TokenStream source, BooleanCla
end = articulationPoints[i];
}
lastState = end;
- final Query queryPos;
+ final Query positionalQuery;
if (graph.hasSidePath(start)) {
- final Iterator<TokenStream> it = graph.getFiniteStrings(start, end);
+ final Iterator<TokenStream> sidePathsIterator =
graph.getFiniteStrings(start, end);
Iterator<Query> queries = new Iterator<Query>() {
@Override
public boolean hasNext() {
- return it.hasNext();
+ return sidePathsIterator.hasNext();
}
@Override
public Query next() {
- TokenStream ts = it.next();
- return createFieldQuery(ts, BooleanClause.Occur.MUST, field,
getAutoGenerateMultiTermSynonymsPhraseQuery(), 0);
+ TokenStream sidePath = sidePathsIterator.next();
+ return createFieldQuery(sidePath, BooleanClause.Occur.MUST, field,
getAutoGenerateMultiTermSynonymsPhraseQuery(), 0);
}
};
- queryPos = newGraphSynonymQuery(queries);
+ positionalQuery = newGraphSynonymQuery(queries);
} else {
- Term[] terms = graph.getTerms(field, start);
+ List<AttributeSource> attributes = graph.getTerms(start);
Review comment:
I think I mentioned a List of AttributeSource is weird (I've never seen
this) and it's heavyweight. Why not a TokenStream or TermAndBoost[] ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]