org.apache.nutch.searcher.basic
Class BasicQueryFilter

java.lang.Object
  extended by org.apache.nutch.searcher.basic.BasicQueryFilter
All Implemented Interfaces:
Configurable, Pluggable, QueryFilter

public class BasicQueryFilter
extends Object
implements QueryFilter

The default query filter. Query terms in the default query field are expanded to search the url, anchor and content document fields. Additional fields can be added by specifying parameters of the form : query.basic.(fieldname).boost to the configuration files (see nutch-default.xml for an example).Such fields will be used in the clauses generated by the BasicQueryFilter e.g. for a user query A B, it generates +(field1:A field2:A ...) +(field1:B field2:B....). If you don't want the additional fields to be included in the clauses you will need to implement a custom query filter for it.


Field Summary
 
Fields inherited from interface org.apache.nutch.searcher.QueryFilter
X_POINT_ID
 
Constructor Summary
BasicQueryFilter()
           
 
Method Summary
 BooleanQuery filter(Query input, BooleanQuery output)
          Adds clauses or otherwise modifies the BooleanQuery that will be searched.
 Configuration getConf()
           
 void setAnchorBoost(float boost)
          Set the boost factor for title/anchor matches, relative to url and content matches.
 void setConf(Configuration conf)
           
 void setPhraseBoost(float boost)
          Set the boost factor for sloppy phrase matches relative to unordered term matches.
 void setSlop(int slop)
          Set the maximum number of terms permitted between matching terms in a sloppy phrase match.
 void setUrlBoost(float boost)
          Set the boost factor for url matches, relative to content and anchor matches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicQueryFilter

public BasicQueryFilter()
Method Detail

setUrlBoost

public void setUrlBoost(float boost)
Set the boost factor for url matches, relative to content and anchor matches


setAnchorBoost

public void setAnchorBoost(float boost)
Set the boost factor for title/anchor matches, relative to url and content matches.


setPhraseBoost

public void setPhraseBoost(float boost)
Set the boost factor for sloppy phrase matches relative to unordered term matches.


setSlop

public void setSlop(int slop)
Set the maximum number of terms permitted between matching terms in a sloppy phrase match.


filter

public BooleanQuery filter(Query input,
                           BooleanQuery output)
Description copied from interface: QueryFilter
Adds clauses or otherwise modifies the BooleanQuery that will be searched.

Specified by:
filter in interface QueryFilter

setConf

public void setConf(Configuration conf)
Specified by:
setConf in interface Configurable

getConf

public Configuration getConf()
Specified by:
getConf in interface Configurable


Copyright © 2006 The Apache Software Foundation