public class UniqueGroupingSearcher extends Searcher
Modifier and Type | Field and Description |
---|---|
(package private) static String |
LABEL_COUNT |
(package private) static String |
LABEL_GROUPS |
(package private) static String |
LABEL_HITS |
private static Logger |
log |
private static HitOrderer |
NOP_ORDERER |
static com.yahoo.processing.request.CompoundName |
PARAM_UNIQUE |
Constructor and Description |
---|
UniqueGroupingSearcher() |
Modifier and Type | Method and Description |
---|---|
(package private) static GroupingOperation |
buildGroupingExpression(String dedupField,
int groupingHits,
String summaryClass,
Sorting sortSpec) |
private static GroupingOperation |
buildGroupingExpressionWithRanking(String dedupField,
int groupingHits,
String summaryClass)
Create the grouping expression when ranking is used for ordering
(which is the default for grouping expressions, so ranking is not explicitly mentioned).
|
private static GroupingOperation |
buildGroupingExpressionWithSorting(String dedupField,
int groupingHits,
String summaryClass,
Sorting sortSpec)
Create the grouping expression when sorting is used for ordering
This grouping expression is more complicated and probably quite a bit heavier to execute.
|
private static GroupingExpression |
createGroupOrderingClause(Sorting sortingSpec)
Create a hit ordering clause based on the sorting spec.
|
private static List<GroupingExpression> |
createHitOrderingClause(Sorting sortingSpec)
Create a hit ordering clause based on the sorting spec.
|
private static Result |
dedupe(Query query,
Execution execution,
String dedupField)
Until we can use the grouping pagination features in 5.1, we'll have to support offset
by simply requesting and discarding hit #0 up to hit #offset.
|
private static List<Hit> |
getAllHitsFromGroupingResult(GroupList resultGroups)
Get all the hits returned by the grouping request.
|
private static List<Hit> |
getRequestedHits(GroupList resultGroups,
int offset,
int hits)
Retrieve the actually unique hits from the grouping results.
|
Result |
search(Query query,
Execution execution)
Implements the deprecated "unique" api for deduplication by using grouping.
|
ensureFilled, fill, getLogger, process, toString
getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
public static final com.yahoo.processing.request.CompoundName PARAM_UNIQUE
private static final Logger log
private static final HitOrderer NOP_ORDERER
static final String LABEL_COUNT
static final String LABEL_GROUPS
static final String LABEL_HITS
public Result search(Query query, Execution execution)
private static Result dedupe(Query query, Execution execution, String dedupField)
private static List<GroupingExpression> createHitOrderingClause(Sorting sortingSpec)
sortingSpec
- A (single level!) sorting specificationprivate static GroupingExpression createGroupOrderingClause(Sorting sortingSpec)
sortingSpec
- A (single level!) sorting specificationprivate static List<Hit> getRequestedHits(GroupList resultGroups, int offset, int hits)
resultGroups
- the results of the dedup grouping expression.offset
- the requested offset. Hits before this are discarded.hits
- the requested number of hits. Hits in excess of this are discarded.private static List<Hit> getAllHitsFromGroupingResult(GroupList resultGroups)
resultGroups
- The result group of the dedup grouping requeststatic GroupingOperation buildGroupingExpression(String dedupField, int groupingHits, String summaryClass, Sorting sortSpec)
private static GroupingOperation buildGroupingExpressionWithRanking(String dedupField, int groupingHits, String summaryClass)
private static GroupingOperation buildGroupingExpressionWithSorting(String dedupField, int groupingHits, String summaryClass, Sorting sortSpec)
Copyright © 2018. All rights reserved.