|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.yahoo.prelude.Searcher
com.yahoo.prelude.ChainedSearcher
com.yahoo.shopping.XSearcher
public class XSearcher
The XSearcher plug-in provides functionality to focus the search: - Allows for context queries, i.e. queries that include terms that describe the desired context, with no specific knowledge about the query language or document structure needed. - Keyword and context terms in a query is treated differently, using the context terms only for focusing the search. - Provides a generic and flexible framework for hybrid search.
Nested Class Summary | |
---|---|
private static class |
XSearcher.NraHitOrderer
Sorts NraHit objects, firstby lower bound, then by upper bound. |
Field Summary | |
---|---|
private java.util.HashMap<java.lang.String,java.lang.String> |
depMap
|
private java.util.HashMap<java.lang.String,java.lang.String> |
firstNamesMap
|
private java.util.TreeMap<java.lang.String,java.lang.String> |
invertedXmlDocumentTree
|
private java.util.HashMap<java.lang.String,java.lang.String> |
ontology
|
private java.util.HashMap<java.lang.String,java.lang.String> |
surNamesMap
|
private java.util.HashMap<java.lang.String,java.lang.String> |
xmlDocumentTree
|
Constructor Summary | |
---|---|
XSearcher()
The constructor initiates the data structures. |
Method Summary | |
---|---|
private java.lang.String[] |
analyseQuery(com.yahoo.prelude.Query query,
boolean properName)
The method recognises context terms and proper names. |
private void |
buildNamesMap(java.lang.String fileName)
The method reads a file, and stores the value of each line in a HashMap. |
com.yahoo.prelude.Result |
doSearch(com.yahoo.prelude.Query query,
int offset,
int hits)
This method is called each time a search is performed. |
private com.yahoo.prelude.Result |
doSuperSearch(com.yahoo.prelude.Query query,
int offset,
int hits,
java.lang.String currentLabel,
java.lang.String contextLabel,
boolean removeContextWord)
Modifies the query by calling modifyQuery(), and sends it to the next Searcher in the chain. |
private com.yahoo.prelude.Result |
doXmlSearch(com.yahoo.prelude.Query query,
java.lang.String contextLabel,
int properNameFound,
int offset,
int hits,
int k,
AggregationFunction aggrFunc)
Traverses the XML structure from the root context node found in analyseQuery(), performs a search by calling doXSearch() for each leaf node, and merges the subresults by calling mergeResults(). |
private com.yahoo.prelude.Result |
doXSearch(java.lang.String contextLabel,
int properNameFound,
int offset,
int hits,
java.util.ArrayList<com.yahoo.prelude.Result> subResults,
com.yahoo.prelude.Query query,
java.lang.String currentLabel)
This method is a workaround, caused by inadequate labelling of parts of the document corpus. |
private com.yahoo.prelude.Result |
mergeResults(com.yahoo.prelude.Query query,
java.util.ArrayList<com.yahoo.prelude.Result> subResults,
int k,
AggregationFunction aggrFunc)
Merges the subresults by performing the No Random Access algorithm. |
private com.yahoo.prelude.query.Item |
modifyQuery(com.yahoo.prelude.query.Item item,
java.lang.String currentLabel,
java.lang.String contextLabel,
boolean removeContextWord)
The method traverses the query tree, and performs the following modifications: - Removal of a keyword recognised as a context term |
Methods inherited from class com.yahoo.prelude.ChainedSearcher |
---|
addChained, doFill, doPing, getChained, getEditionTimeStamp, setChained |
Methods inherited from class com.yahoo.prelude.Searcher |
---|
addChained, fill, getId, getLogger, getNeedOffsetChecking, initialize, isLoggingFine, search, setNeedOffsetChecking |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.HashMap<java.lang.String,java.lang.String> xmlDocumentTree
private java.util.HashMap<java.lang.String,java.lang.String> ontology
private java.util.TreeMap<java.lang.String,java.lang.String> invertedXmlDocumentTree
private java.util.HashMap<java.lang.String,java.lang.String> firstNamesMap
private java.util.HashMap<java.lang.String,java.lang.String> surNamesMap
private java.util.HashMap<java.lang.String,java.lang.String> depMap
Constructor Detail |
---|
public XSearcher()
Method Detail |
---|
public com.yahoo.prelude.Result doSearch(com.yahoo.prelude.Query query, int offset, int hits)
doSearch
in class com.yahoo.prelude.ChainedSearcher
query
- Query as it is forwarded from the previous Searcher in the chain.offset
- The first hit number to retrieve.hits
- The number of hits to retrieve in each subresult.
private void buildNamesMap(java.lang.String fileName)
fileName
- The file name that is to be opened and read from.private java.lang.String[] analyseQuery(com.yahoo.prelude.Query query, boolean properName)
query
- The raw query to be traversed.properName
- Whether proper name recognition should be utilised.
private com.yahoo.prelude.Result doXmlSearch(com.yahoo.prelude.Query query, java.lang.String contextLabel, int properNameFound, int offset, int hits, int k, AggregationFunction aggrFunc)
query
- The raw query.contextLabel
- The Dewey number of the desired context node.properNameFound
- Whether all query keywords (except the context term) are proper names.offset
- The first hit number to retrieve.hits
- The number of hits to retrieve in each subresult.k
- The number of hits to return in the merged result.aggrFunc
- Which aggregation function that should be used.
private com.yahoo.prelude.Result doXSearch(java.lang.String contextLabel, int properNameFound, int offset, int hits, java.util.ArrayList<com.yahoo.prelude.Result> subResults, com.yahoo.prelude.Query query, java.lang.String currentLabel)
contextLabel
- The Dewey number of the desired context node.properNameFound
- Whether all query keywords (except the context term) are proper names.offset
- The first hit number to retrieve.hits
- The number of hits to retrieve in each subresult.query
- The raw query.currentLabel
- The Dewey number of the current node to be searched in.
private com.yahoo.prelude.Result doSuperSearch(com.yahoo.prelude.Query query, int offset, int hits, java.lang.String currentLabel, java.lang.String contextLabel, boolean removeContextWord)
query
- The hacked query.offset
- The first hit number to retrieve.hits
- The number of hits to retrieve in each subresult.currentLabel
- The Dewey number of the current node to be searched in.contextLabel
- The Dewey number of the desired context node.removeContextWord
- Whether the context term should be removed from the query.
private com.yahoo.prelude.query.Item modifyQuery(com.yahoo.prelude.query.Item item, java.lang.String currentLabel, java.lang.String contextLabel, boolean removeContextWord)
item
- The hacked query root.currentLabel
- The Dewey number of the current node to be searched in.contextLabel
- The Dewey number of the desired context node.removeContextWord
- Whether the context term should be removed from the query.
private com.yahoo.prelude.Result mergeResults(com.yahoo.prelude.Query query, java.util.ArrayList<com.yahoo.prelude.Result> subResults, int k, AggregationFunction aggrFunc)
query
- The original query.subResults
- The subresults to be merged.k
- The number of hits to return in the merged result.aggrFunc
- Which aggregation function that should be used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |