|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.search.components.impl.DefaultSearcherImpl
public class DefaultSearcherImpl
use lucene MultiSearcher
| Field Summary | |
|---|---|
protected java.util.List |
directories
Lucene Directory |
protected org.apache.lucene.search.Searcher |
luceneSearcher
Lucene Searcher |
protected org.apache.lucene.search.SortField |
sortfield
Lucene SortField |
| Fields inherited from interface org.apache.cocoon.components.search.components.Searcher |
|---|
ROLE |
| Constructor Summary | |
|---|---|
DefaultSearcherImpl()
|
|
| Method Summary | |
|---|---|
void |
addDirectory(org.apache.lucene.store.Directory directory)
Add a lucene directory -- you can add several directories The directory specifies the directory used for looking up the index. |
void |
dispose()
|
protected void |
getLuceneSearcher()
|
void |
recycle()
|
org.apache.lucene.search.Hits |
search(org.apache.lucene.search.Query query)
Search using a Lucene Query object, returning zero, or more hits. |
void |
setSortField(java.lang.String field,
boolean reverse)
Set the field by which the search results are to be sorted |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List directories
protected org.apache.lucene.search.SortField sortfield
protected org.apache.lucene.search.Searcher luceneSearcher
| Constructor Detail |
|---|
public DefaultSearcherImpl()
| Method Detail |
|---|
protected void getLuceneSearcher()
throws java.io.IOException
java.io.IOExceptionpublic void addDirectory(org.apache.lucene.store.Directory directory)
SearcherThe directory specifies the directory used for looking up the index. It defines the physical place of the index
addDirectory in interface Searcherdirectory - The new directory value
public org.apache.lucene.search.Hits search(org.apache.lucene.search.Query query)
throws org.apache.cocoon.ProcessingException
Searcher
search in interface Searcherquery - A lucene query
org.apache.cocoon.ProcessingException - throwing due to processing errors while looking up the index
directory, parsing the query string, generating the hits.
public void setSortField(java.lang.String field,
boolean reverse)
Searcher
setSortField in interface Searcherfield - the index fieldreverse - reverse order or notpublic void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposablepublic void recycle()
recycle in interface org.apache.avalon.excalibur.pool.Recyclable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||