org.terrier.querying
Class Scope

java.lang.Object
  extended by 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
Scope()
           
 
Method Summary
 byte filter(Manager m, SearchRequest srq, ResultSet rs, int DocAtNo, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scope

public Scope()
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 interface PostFilter
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 DocAtNo,
                   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 interface PostFilter
Parameters:
m - The manager controlling this query
srq - The search request being processed
rs - the resultset that is being iterated through
DocAtNo - which array index in the resultset have we reached
docid - The document number of the currently being procesed result.


Terrier 3.5. Copyright © 2004-2011 University of Glasgow