bruno-roustant 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_r303910866
########## 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: Yes it makes a difference. The lambda instance is created once, compared to inside the loop where a lambda instance is created for each step of the loop because the collection is not static. ---------------------------------------------------------------- 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