org.terrier.querying
Class SiteFilter

java.lang.Object
  extended by org.terrier.querying.SiteFilter
All Implemented Interfaces:
PostFilter

public class SiteFilter
extends java.lang.Object
implements PostFilter

Filter that removes hosts which dont match an appropriate site: constraint, as specified in a control. E.g. site:uk will remove any documents which do not have a hostname ending in uk Assumes that the metadata set has already been decorated with the url.

Since:
3.0
Author:
Craig Macdonald

Field Summary
protected  java.lang.String site
           
 
Fields inherited from interface org.terrier.querying.PostFilter
FILTER_ADJUSTED, FILTER_OK, FILTER_REMOVE
 
Constructor Summary
SiteFilter()
           
 
Method Summary
 byte filter(Manager m, SearchRequest srq, ResultSet rs, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

site

protected java.lang.String site
Constructor Detail

SiteFilter

public SiteFilter()
Method Detail

new_query

public 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.

Specified by:
new_query in interface PostFilter
Parameters:
m - The manager controlling this query
srq - The search request being processed
rs - the resultset that is being iterated through

filter

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

Specified by:
filter in interface PostFilter
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 3.5. Copyright © 2004-2011 University of Glasgow