public class RelevanceNormalizer extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
RELEVANCE_TIMER |
| Constructor and Description |
|---|
RelevanceNormalizer(ddf.catalog.filter.FilterAdapter filterAdapter) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canNormalizeQuery(Map<String,String> filterParameters)
Checks to see if this query can be normalized.
|
protected Map<String,String> |
getFilterParameters(ddf.catalog.operation.Query originalQuery) |
protected org.apache.lucene.search.Query |
getQuery(org.apache.lucene.queryparser.classic.QueryParser parser,
Map<String,String> filterParameters) |
protected String |
getSearchPhrase(Map<String,String> filterParameters)
Pull out the string-based search phrase from a query.
|
List<ddf.catalog.data.Result> |
normalize(List<ddf.catalog.data.Result> results,
ddf.catalog.operation.Query originalQuery)
Normalize the relevance score for the results in the query response based on the contextual query criteria
|
protected ddf.catalog.data.Result |
updateResult(ddf.catalog.data.Result origResult,
float newScore)
Creates a new result with an updated score.
|
public static final String RELEVANCE_TIMER
public RelevanceNormalizer(ddf.catalog.filter.FilterAdapter filterAdapter)
public List<ddf.catalog.data.Result> normalize(List<ddf.catalog.data.Result> results, ddf.catalog.operation.Query originalQuery)
results - originalQuery - protected boolean canNormalizeQuery(Map<String,String> filterParameters)
filterParameters - parameters from original ddf queryprotected org.apache.lucene.search.Query getQuery(org.apache.lucene.queryparser.classic.QueryParser parser,
Map<String,String> filterParameters)
throws org.apache.lucene.queryparser.classic.ParseException
org.apache.lucene.queryparser.classic.ParseExceptionprotected String getSearchPhrase(Map<String,String> filterParameters)
filterParameters - filterparameters from the original queryprotected Map<String,String> getFilterParameters(ddf.catalog.operation.Query originalQuery)
protected ddf.catalog.data.Result updateResult(ddf.catalog.data.Result origResult,
float newScore)
origResult - Original result that contains an older score.newScore - New score to update the result with.Copyright © 2014–2015 Cohesive Integrations, LLC. All rights reserved.