dsmiley commented on a change in pull request #780: SOLR-11866: Support efficient subset matching in query elevation rules URL: https://github.com/apache/lucene-solr/pull/780#discussion_r303891904
########## File path: solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java ########## @@ -896,13 +892,18 @@ public Elevation getElevationForQuery(String queryString) { } return exactMatchElevationMap.get(analyzeQuery(queryString)); } - StringBuilder concatenatedTerms = hasExactMatchElevationRules ? new StringBuilder() : null; Collection<String> queryTerms = new ArrayList<>(); - analyzeQuery(queryString, queryTerms, concatenatedTerms); + Consumer<String> termsConsumer = queryTerms::add; + StringBuilder concatTerms = null; + if (hasExactMatchElevationRules) { + concatTerms = new StringBuilder(); + termsConsumer = termsConsumer.andThen(concatTerms::append); Review comment: Ha! Love it ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org