|
|||||||||
Home >> All >> com >> RuntimeCollective >> search >> [ bean overview ] | PREV PACKAGE NEXT PACKAGE |
Package com.RuntimeCollective.search.bean
The Search module uses Jakarta Lucene to provide a (hopefully) flexible search facility for Java objects.
See:
Description
Interface Summary | |
Searchable | A javabean must implement this interface to be searchable. |
Class Summary | |
Search | Represents a search query made by a user. |
SearchCriterion | One criterion to search by. |
SearchResult | A single search result. |
SearchResults | A collection of SearchResult objects, with methods to access them conveniently from a jsp |
Package com.RuntimeCollective.search.bean Description
The Search module uses Jakarta Lucene to provide a (hopefully) flexible search facility for Java objects.
1. search.servlet.SearchInitialiserServlet
To use the Search module, add the following servlet to yourweb.xml
:
<!-- Search Initialization Servlet -->
<servlet>
<servlet-name>searchInitialiser</servlet-name>
<servlet-class>com.RuntimeCollective.search.servlet.SearchInitialiserServlet</servlet-class>
<load-on-startup>3</load-on-startup>
</servlet>
Add the following as a parameter to the com.RuntimeCollective.webapps.servlet.InitialiserServlet
:
<init-param>
<param-name>param.searchIndex</param-name>
<param-value>/home/joe/tomcat/webapps/ROOT/lucene</param-value>
</init-param>
specifying the location in the file system you'd like to store the Lucene search index in. This should be a directory, but does not have to exist - it will be created if not.
2. search.bean.Searchable
To make your class searchable, make it implement theSearchable
interface. See the javadoc for details.
Example: ContentSiteLocation implements Searchable
.
3. search.SearchIndex
Use the search index to add/remove Searchables from the index (withadd/removeSearchable
).
Example: ContentSiteLocation adds and removes CSLs from the search index
4. search.bean.Search
UseSearch
to perform searches, by adding SearchCriterion
objects with the addCriterion
method, then calling getResults
.
Example: SearchAction performs a search.
|
|||||||||
Home >> All >> com >> RuntimeCollective >> search >> [ bean overview ] | PREV PACKAGE NEXT PACKAGE |