Package org.terrier.querying
Class Scope
- java.lang.Object
-
- org.terrier.querying.Scope
-
- All Implemented Interfaces:
PostFilter
public class Scope extends java.lang.Object implements PostFilter
Checks that the prefix of the document number (upto the first "-") is included in this list of scopes as given by the scope control. This is a PostFilter, so new_query() is called for each new query, and filter() is called for each result in the resultset.- Author:
- Craig Macdonald
-
-
Field Summary
-
Fields inherited from interface org.terrier.querying.PostFilter
FILTER_ADJUSTED, FILTER_OK, FILTER_REMOVE
-
-
Constructor Summary
Constructors Constructor Description Scope()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
filter(Manager m, SearchRequest srq, ResultSet rs, int rank, int docid)
Called for each result in the resultset, used to filter out unwanted results, based on the presence of some strings in the document number.void
new_query(Manager m, SearchRequest srq, ResultSet rs)
Creates a HashSet of scopes that can are allowed to be in the document number prefix.
-
-
-
Method Detail
-
new_query
public void new_query(Manager m, SearchRequest srq, ResultSet rs)
Creates a HashSet of scopes that can are allowed to be in the document number prefix.- Specified by:
new_query
in interfacePostFilter
- Parameters:
m
- Manager the manager used for processing the request.srq
- SearchRequest the search request to process.rs
- ResultSet the result set for the search request.
-
filter
public byte filter(Manager m, SearchRequest srq, ResultSet rs, int rank, int docid)
Called for each result in the resultset, used to filter out unwanted results, based on the presence of some strings in the document number. The document number upto the first "-" is checked for presence in the scopes HashSet.- Specified by:
filter
in interfacePostFilter
- Parameters:
m
- The manager controlling this querysrq
- The search request being processedrs
- the resultset that is being iterated throughrank
- the array index in the resultset have we reacheddocid
- The document number of the currently being processed result.
-
-