|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.querying.Decorate
public class Decorate
This class decorates a result set with metadata. This metadata can be highlighted, can have a query biased summary created, and also be escaped for display in another format. Controls: <ul>
Field Summary | |
---|---|
protected static java.lang.String[] |
CONTROL_VALUE_DELIMS
delimiters for breaking down the values of controls further |
protected static java.util.regex.Pattern |
controlNonVisibleCharacters
|
protected java.util.regex.Matcher |
controlNonVisibleCharactersMatcher
|
protected static StringTools.ESCAPE |
defaultEscape
what is the default escape sequence |
protected java.util.regex.Pattern |
highlight
highlighting pattern for the current query |
protected LRUMap<java.lang.Integer,java.lang.String[]> |
metaCache
The cache used for the meta data. |
protected MetaIndex |
metaIndex
The meta index server. |
protected java.lang.String[] |
qTerms
query terms of the current query |
Fields inherited from interface org.terrier.querying.PostFilter |
---|
FILTER_ADJUSTED, FILTER_OK, FILTER_REMOVE |
Constructor Summary | |
---|---|
Decorate()
|
Method Summary | |
---|---|
protected boolean |
checkControl(java.lang.String control_name,
SearchRequest srq)
|
byte |
filter(Manager m,
SearchRequest q,
ResultSet rs,
int rank,
int docid)
Called for each result in the resultset, used to filter out unwanted results. |
protected java.util.regex.Pattern |
generateEmphasisPattern(java.lang.String[] _qTerms)
Creates a regular expression pattern to highlight query terms metadata. |
protected java.lang.String |
generateQueryBiasedSummary(java.lang.String extract,
java.lang.String[] _qTerms)
|
java.lang.String |
getInfo()
Returns the name of the post processor. |
protected java.lang.String[] |
getMetadata(java.lang.String[] metaKeys,
int docid)
|
protected java.lang.String[][] |
getMetadata(java.lang.String[] metaKeys,
int[] docids)
|
void |
new_query(Manager m,
SearchRequest q,
ResultSet rs)
Called before the processing of a resultset using this PostFilter is applied. |
void |
process(Manager manager,
SearchRequest q)
decoration at the postprocess stage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String[] CONTROL_VALUE_DELIMS
protected LRUMap<java.lang.Integer,java.lang.String[]> metaCache
protected MetaIndex metaIndex
protected static final java.util.regex.Pattern controlNonVisibleCharacters
protected static final StringTools.ESCAPE defaultEscape
protected java.util.regex.Matcher controlNonVisibleCharactersMatcher
protected java.util.regex.Pattern highlight
protected java.lang.String[] qTerms
Constructor Detail |
---|
public Decorate()
Method Detail |
---|
public void new_query(Manager m, SearchRequest q, ResultSet rs)
new_query
in interface PostFilter
m
- The manager controlling this queryq
- The search request being processedrs
- the resultset that is being iterated throughpublic byte filter(Manager m, SearchRequest q, ResultSet rs, int rank, int docid)
filter
in interface PostFilter
m
- The manager controlling this queryq
- The search request being processedrank
- which array index in the resultset have we reacheddocid
- The document number of the currently being procesed result.public void process(Manager manager, SearchRequest q)
process
in interface Process
manager
- The manager instance handling this search session.q
- the current query being processedprotected java.lang.String[] getMetadata(java.lang.String[] metaKeys, int docid)
protected java.lang.String[][] getMetadata(java.lang.String[] metaKeys, int[] docids)
protected java.lang.String generateQueryBiasedSummary(java.lang.String extract, java.lang.String[] _qTerms)
protected java.util.regex.Pattern generateEmphasisPattern(java.lang.String[] _qTerms)
_qTerms
- query terms
protected boolean checkControl(java.lang.String control_name, SearchRequest srq)
public java.lang.String getInfo()
getInfo
in interface Process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |