Package org.terrier.querying
Interface PostFilter
-
- All Known Implementing Classes:
Decorate
,Scope
,SimpleDecorate
,SiteFilter
public interface PostFilter
PostFilters are designed to complement PostProcesses. While PostProcesses operate on the entire resultset at once, with PostFilters, each PostFilter is called for each result in the resultset. According to the return of filter() the result can then be included, discarded, or (un)boosted in the resultset. Possible return values for filter are FILTER_OK, FILTER_REMOVE, FILTER_ADJUSTED Which PostFilters are run, and when is controlled by two properties, as mentioned below.
Properties- querying.postfilters : A comma separated list of control to PostFilter class mappings, in the order postfilters should be run in. Mappings are separated by ":". eg querying.postfilters=scope:Scope
- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description static byte
FILTER_ADJUSTED
The score for this result has been adjusted, please ensure the resultset is re-sortedstatic byte
FILTER_OK
This result should be included in the resultsetstatic byte
FILTER_REMOVE
This result should not be included in the resultset
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte
filter(Manager m, SearchRequest srq, ResultSet results, int DocAtNumber, int docid)
Called for each result in the resultset, used to filter out unwanted results.void
new_query(Manager m, SearchRequest srq, ResultSet rs)
Called before the processing of a resultset using this PostFilter is applied.
-
-
-
Field Detail
-
FILTER_OK
static final byte FILTER_OK
This result should be included in the resultset- See Also:
- Constant Field Values
-
FILTER_REMOVE
static final byte FILTER_REMOVE
This result should not be included in the resultset- See Also:
- Constant Field Values
-
FILTER_ADJUSTED
static final byte FILTER_ADJUSTED
The score for this result has been adjusted, please ensure the resultset is re-sorted- See Also:
- Constant Field Values
-
-
Method Detail
-
new_query
void new_query(Manager m, SearchRequest srq, ResultSet rs)
Called before the processing of a resultset using this PostFilter is applied. Can be used to save information for the duration of the query.- Parameters:
m
- The manager controlling this querysrq
- The search request being processedrs
- the resultset that is being iterated through
-
filter
byte filter(Manager m, SearchRequest srq, ResultSet results, int DocAtNumber, int docid)
Called for each result in the resultset, used to filter out unwanted results.- Parameters:
m
- The manager controlling this querysrq
- The search request being processedDocAtNumber
- which array index (rank) in the resultset have we reacheddocid
- The docid of the currently being procesed result.
-
-