Class QueryElevationComponent.DefaultElevationProvider
- java.lang.Object
-
- org.apache.solr.handler.component.QueryElevationComponent.DefaultElevationProvider
-
- All Implemented Interfaces:
QueryElevationComponent.ElevationProvider
- Enclosing class:
- QueryElevationComponent
protected class QueryElevationComponent.DefaultElevationProvider extends Object implements QueryElevationComponent.ElevationProvider
Provides elevations with either:- subset match - all the elevating terms are matched in the search query, in any order.
- exact match - the elevating query matches fully (all terms in same order) the search query.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultElevationProvider(QueryElevationComponent.TrieSubsetMatcher.Builder<String,QueryElevationComponent.Elevation> subsetMatcherBuilder, Map<QueryElevationComponent.ElevatingQuery,QueryElevationComponent.ElevationBuilder> elevationBuilderMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryElevationComponent.ElevationgetElevationForQuery(String queryString)Gets the elevation associated to the provided query.intsize()Gets the number of query elevations in thisQueryElevationComponent.ElevationProvider.
-
-
-
Constructor Detail
-
DefaultElevationProvider
protected DefaultElevationProvider(QueryElevationComponent.TrieSubsetMatcher.Builder<String,QueryElevationComponent.Elevation> subsetMatcherBuilder, Map<QueryElevationComponent.ElevatingQuery,QueryElevationComponent.ElevationBuilder> elevationBuilderMap)
- Parameters:
subsetMatcherBuilder- TheQueryElevationComponent.TrieSubsetMatcher.Builderto build theQueryElevationComponent.TrieSubsetMatcher.elevationBuilderMap- The map of elevation rules.
-
-
Method Detail
-
getElevationForQuery
public QueryElevationComponent.Elevation getElevationForQuery(String queryString)
Description copied from interface:QueryElevationComponent.ElevationProviderGets the elevation associated to the provided query.By contract and by design, only one elevation may be associated to a given query (this can be safely verified by an assertion).
- Specified by:
getElevationForQueryin interfaceQueryElevationComponent.ElevationProvider- Parameters:
queryString- The query string (notanalyzedyet, thisQueryElevationComponent.ElevationProvideris in charge of analyzing it).- Returns:
- The elevation associated with the query; or
nullif none.
-
size
public int size()
Description copied from interface:QueryElevationComponent.ElevationProviderGets the number of query elevations in thisQueryElevationComponent.ElevationProvider.- Specified by:
sizein interfaceQueryElevationComponent.ElevationProvider
-
-