org.apache.cocoon.components.search
Interface LuceneCocoonSearcher

All Superinterfaces:
org.apache.avalon.framework.component.Component
All Known Implementing Classes:
SimpleLuceneCocoonSearcherImpl

public interface LuceneCocoonSearcher
extends org.apache.avalon.framework.component.Component

The avalon behavioural component interface of a searcher.

This component defines an interface for searching. The idea is to abstract the process of searching having a query string, and an index, and generating hits which matches the query string in the index.

Version:
CVS $Id: LuceneCocoonSearcher.java,v 1.3 2002/02/22 07:00:12 cziegeler Exp $
Author:
Bernhard Huber

Field Summary
static java.lang.String ROLE
          The ROLE name of this avalon component.
 
Method Summary
 org.apache.lucene.search.Hits search(java.lang.String query_string, java.lang.String default_field)
          Search a query-string, returning zero, or more hits.
 void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
          Sets the analyzer attribute of the LuceneCocoonSearcher object The analyzer determines the tokenization of the query, and strategy of matching.
 void setDirectory(org.apache.lucene.store.Directory directory)
          Sets the directory attribute of the LuceneCocoonSearcher object The directory specifies the directory used for looking up the index.
 

Field Detail

ROLE

public static final java.lang.String ROLE
The ROLE name of this avalon component.

Its value if the FQN of this interface, ie. org.apache.cocoon.components.search.LuceneCocoonSearcher.

Since:
 
Method Detail

setAnalyzer

public void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
Sets the analyzer attribute of the LuceneCocoonSearcher object

The analyzer determines the tokenization of the query, and strategy of matching.

The analyzer class defined here should be equivalent to the analyzer class used when creating the index used for searching.

Parameters:
analyzer - The new analyzer value
Since:
 

setDirectory

public void setDirectory(org.apache.lucene.store.Directory directory)
Sets the directory attribute of the LuceneCocoonSearcher object

The directory specifies the directory used for looking up the index. It defines the physical place of the index

Parameters:
directory - The new directory value
Since:
 

search

public org.apache.lucene.search.Hits search(java.lang.String query_string,
                                            java.lang.String default_field)
                                     throws ProcessingException
Search a query-string, returning zero, or more hits.

Parameters:
query_string - A query string parsable by a query parser.
default_field - The default field of the query string.
Returns:
Hits zero or more hits matching the query string
Throws:
ProcessingException - throwing due to processing errors while looking up the index directory, parsing the query string, generating the hits.
Since:
 


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.