|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
public static final java.lang.String ROLE
Its value if the FQN of this interface,
ie. org.apache.cocoon.components.search.LuceneCocoonSearcher
.
Method Detail |
public void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
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.
analyzer
- The new analyzer valuepublic void setDirectory(org.apache.lucene.store.Directory directory)
The directory specifies the directory used for looking up the index. It defines the physical place of the index
directory
- The new directory valuepublic org.apache.lucene.search.Hits search(java.lang.String query_string, java.lang.String default_field) throws ProcessingException
query_string
- A query string parsable by a query parser.default_field
- The default field of the query string.ProcessingException
- throwing due to processing errors while
looking up the index directory, parsing the query string, generating the hits.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |