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_r303891477
########## File path: solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java ########## @@ -857,31 +851,33 @@ public int size() { * </ul> * The terms are tokenized with the query analyzer. */ - protected class SubsetMatchElevationProvider implements ElevationProvider { + protected class DefaultElevationProvider implements ElevationProvider { - private final SubsetMatcher<String, Elevation> subsetMatcher; + private final TrieSubsetMatcher<String, Elevation> subsetMatcher; private final Map<String, Elevation> exactMatchElevationMap; /** - * @param subsetMatcherBuilder The {@link SubsetMatcher.Builder} to build the {@link SubsetMatcher}. + * @param subsetMatcherBuilder The {@link TrieSubsetMatcher.Builder} to build the {@link TrieSubsetMatcher}. * @param elevationBuilderMap The map of elevation rules. */ - protected SubsetMatchElevationProvider(SubsetMatcher.Builder<String, Elevation> subsetMatcherBuilder, - Map<ElevatingQuery, ElevationBuilder> elevationBuilderMap) { + protected DefaultElevationProvider(TrieSubsetMatcher.Builder<String, Elevation> subsetMatcherBuilder, + Map<ElevatingQuery, ElevationBuilder> elevationBuilderMap) { exactMatchElevationMap = new LinkedHashMap<>(); Collection<String> queryTerms = new ArrayList<>(); - StringBuilder concatenatedTerms = new StringBuilder(); + Consumer<String> termsConsumer = queryTerms::add; Review comment: Is pulling the method reference outside the loop actually more efficient? Please point to info showing this. I'm kinda sad if it is... I like the clean/simplicity of it used where needed. @uschindler I have a feeling you know ---------------------------------------------------------------- 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