public class StemmingSearcher extends Searcher
Modifier and Type | Class and Description |
---|---|
private static class |
StemmingSearcher.Connectivity |
Modifier and Type | Field and Description |
---|---|
static com.yahoo.processing.request.CompoundName |
DISABLE |
private com.yahoo.language.Linguistics |
linguistics |
static String |
STEMMING |
Constructor and Description |
---|
StemmingSearcher(com.yahoo.component.ComponentId id,
com.yahoo.language.Linguistics linguistics) |
StemmingSearcher(com.yahoo.language.Linguistics linguistics) |
Modifier and Type | Method and Description |
---|---|
private void |
andSegmentConnectivity(BlockItem current,
Map<Item,TaggableItem> reverseConnectivity,
CompositeItem composite) |
private Item |
checkBlock(BlockItem b,
boolean isCJK,
com.yahoo.language.Language language,
IndexFacts.Session indexFacts,
Map<Item,TaggableItem> reverseConnectivity) |
private CompositeItem |
chooseCompositeForCJK(BlockItem current,
CompositeItem parent,
String indexName) |
private void |
copyAttributes(Item blockAsItem,
Item replacement) |
private void |
copyWeight(Item block,
Item replacement) |
private AndSegmentItem |
createAndSegment(BlockItem current) |
private Map<Item,TaggableItem> |
createReverseConnectivities(Item root) |
private TaggableItem |
firstWord(CompositeItem composite) |
private StemmingSearcher.Connectivity |
getConnectivity(BlockItem current) |
String |
getFunctionName() |
private Substring |
getOffsets(BlockItem b) |
private double |
getSignificance(BlockItem blockItem) |
private int |
getWeight(Item block) |
private boolean |
hasExplicitSignificance(BlockItem blockItem) |
private TaggableItem |
lastWord(CompositeItem composite) |
private CompositeItem |
phraseSegment(BlockItem current,
String indexName) |
private void |
phraseSegmentConnectivity(BlockItem current,
Map<Item,TaggableItem> reverseConnectivity,
PhraseSegmentItem replacement) |
private Map<Item,TaggableItem> |
populateReverseConnectivityMap(Item root,
Map<Item,TaggableItem> reverseConnectivity) |
private Item |
replaceTerms(Query q,
IndexFacts.Session indexFacts) |
private Item |
scan(Item item,
boolean isCJK,
com.yahoo.language.Language l,
IndexFacts.Session indexFacts,
Map<Item,TaggableItem> reverseConnectivity) |
Result |
search(Query query,
Execution execution)
Override this to implement your searcher.
|
private void |
setConnectivity(BlockItem current,
Map<Item,TaggableItem> reverseConnectivity,
Item replacement) |
private void |
setMetaData(BlockItem current,
Map<Item,TaggableItem> reverseConnectivity,
TaggableItem replacement) |
private void |
setSignificance(PhraseSegmentItem target,
BlockItem original) |
private void |
setSignificance(TaggableItem target,
BlockItem original) |
private void |
setWeight(Item replacement,
int weight) |
private WordItem |
singleStemSegment(Item blockAsItem,
String stem,
String indexName,
Substring substring) |
private TaggableItem |
singleWordSegment(BlockItem current,
com.yahoo.language.process.StemList segment,
Index index,
Substring substring) |
private Item |
stem(BlockItem current,
boolean isCJK,
com.yahoo.language.Language language,
Map<Item,TaggableItem> reverseConnectivity,
Index index) |
ensureFilled, fill, getLogger, process, toString
getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
public static final String STEMMING
public static final com.yahoo.processing.request.CompoundName DISABLE
private final com.yahoo.language.Linguistics linguistics
public StemmingSearcher(com.yahoo.language.Linguistics linguistics)
@Inject public StemmingSearcher(com.yahoo.component.ComponentId id, com.yahoo.language.Linguistics linguistics)
public Result search(Query query, Execution execution)
Searcher
Searcher implementation subclasses will, depending on their type of logic, do one of the following:
Hits come in two kinds - concrete hits are actual content of the kind requested by the user, meta hits are hits which provides information about the collection of hits, on the query, the service and so on.
The query specifies a window into a larger result list that must be returned from the searcher through hits and offset; Searchers which returns list of hits in the top level in the result must return at least hits number of hits (or if impossible; all that are available), starting at the given offset. In addition, searchers are allowed to return any number of meta hits (although this number is expected to be low). For hits contained in nested hit groups, the concept of a window defined by hits and offset is not well defined and does not apply.
Error handling in searchers:
public String getFunctionName()
private Item replaceTerms(Query q, IndexFacts.Session indexFacts)
private Map<Item,TaggableItem> createReverseConnectivities(Item root)
private Map<Item,TaggableItem> populateReverseConnectivityMap(Item root, Map<Item,TaggableItem> reverseConnectivity)
private Item scan(Item item, boolean isCJK, com.yahoo.language.Language l, IndexFacts.Session indexFacts, Map<Item,TaggableItem> reverseConnectivity)
private Item checkBlock(BlockItem b, boolean isCJK, com.yahoo.language.Language language, IndexFacts.Session indexFacts, Map<Item,TaggableItem> reverseConnectivity)
private Item stem(BlockItem current, boolean isCJK, com.yahoo.language.Language language, Map<Item,TaggableItem> reverseConnectivity, Index index)
private void phraseSegmentConnectivity(BlockItem current, Map<Item,TaggableItem> reverseConnectivity, PhraseSegmentItem replacement)
private void andSegmentConnectivity(BlockItem current, Map<Item,TaggableItem> reverseConnectivity, CompositeItem composite)
private StemmingSearcher.Connectivity getConnectivity(BlockItem current)
private TaggableItem firstWord(CompositeItem composite)
private TaggableItem lastWord(CompositeItem composite)
private TaggableItem singleWordSegment(BlockItem current, com.yahoo.language.process.StemList segment, Index index, Substring substring)
private void setMetaData(BlockItem current, Map<Item,TaggableItem> reverseConnectivity, TaggableItem replacement)
private WordItem singleStemSegment(Item blockAsItem, String stem, String indexName, Substring substring)
private void setConnectivity(BlockItem current, Map<Item,TaggableItem> reverseConnectivity, Item replacement)
private CompositeItem chooseCompositeForCJK(BlockItem current, CompositeItem parent, String indexName)
private AndSegmentItem createAndSegment(BlockItem current)
private CompositeItem phraseSegment(BlockItem current, String indexName)
private int getWeight(Item block)
private void setWeight(Item replacement, int weight)
private void setSignificance(PhraseSegmentItem target, BlockItem original)
private void setSignificance(TaggableItem target, BlockItem original)
private boolean hasExplicitSignificance(BlockItem blockItem)
private double getSignificance(BlockItem blockItem)
Copyright © 2018. All rights reserved.