Terrier IR Platform
2.2.1

uk.ac.gla.terrier.querying
Interface PostFilter


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

'''NB:''' Initialisation and running of post filters is carried out by the Manager.

Version:
$Revision: 1.9 $
Author:
Craig Macdonald

Field Summary
static byte FILTER_ADJUSTED
          The score for this result has been adjusted, please ensure the resultset is re-sorted
static byte FILTER_OK
          This result should be included in the resultset
static byte FILTER_REMOVE
          This result should not be included in the resultset
 
Method Summary
 byte filter(Manager m, SearchRequest srq, ResultSet results, int DocAtNumber, int DocNo)
          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 query
srq - The search request being processed
rs - the resultset that is being iterated through

filter

byte filter(Manager m,
            SearchRequest srq,
            ResultSet results,
            int DocAtNumber,
            int DocNo)
Called for each result in the resultset, used to filter out unwanted results.

Parameters:
m - The manager controlling this query
srq - The search request being processed
DocAtNumber - which array index in the resultset have we reached
DocNo - The document number of the currently being procesed result.

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow