org.apache.cocoon.components.search
Interface LuceneCocoonSearcher

All Superinterfaces:
Component
All Known Implementing Classes:
SimpleLuceneCocoonSearcherImpl

public interface LuceneCocoonSearcher
extends 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.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Bernhard Huber

Field Summary
static String ROLE
          The ROLE name of this avalon component.
 
Method Summary
 org.apache.lucene.analysis.Analyzer getAnalyzer()
          Gets the analyzer attribute of the LuceneCocoonSearcher object The analyzer determines the tokenization of the query, and strategy of matching.
 org.apache.lucene.search.Hits search(org.apache.lucene.search.Query query)
          Search using a Lucene Query object, returning zero, or more hits.
 org.apache.lucene.search.Hits search(String query_string, 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

static final 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:
See Also:
Constant Field Values
Method Detail

setAnalyzer

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:

getAnalyzer

org.apache.lucene.analysis.Analyzer getAnalyzer()
Gets 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.

Since:
2.1.6

setDirectory

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

org.apache.lucene.search.Hits search(String query_string,
                                     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:

search

org.apache.lucene.search.Hits search(org.apache.lucene.search.Query query)
                                     throws ProcessingException
Search using a Lucene Query object, returning zero, or more hits.

Parameters:
query - A lucene query
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:
2.1.6


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.