|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.arsdigita.search.Search
The Search class provides an application level API
for querying search indexes. It implements transparent
caching of search results across requests for performance.
Applications would typically present a form to the user
allowing them to enter a query specification. They
would then invoke the process method to
obtain a (optionally cached) document result set. For
here the getResults method enables easy
pagination of documents. An example interaction may
look like:
QuerySpecification querySpec = getQuerySpec(request);
ResultSet results = Search.process(querySpec);
int pageNum = request.getParameter("pageNum");
Iterator onePage = results.getResults(pageNum*PAGE_SIZE, PAGE_SIZE);
while (onePage.hasNext()) {
Document doc = (Document)onePage.next();
... do something with doc ...
}
| Field Summary | |
static int |
CACHE_DOCUMENT_COUNT
The default search result cache size |
static long |
CACHE_LIFETIME
The default search result cache lifetime, in milliseconds |
static long |
CACHE_SIZE
The default search result cache size |
static ResultCache |
DEFAULT_RESULT_CACHE
|
static ResultSet |
EMPTY_RESULT_SET
A document result set containing no results |
static String |
INDEXER_INTERMEDIA
Deprecated. use IndexerType.INTERMEDIA.getKey() |
static String |
INDEXER_LUCENE
Deprecated. use IndexerType.LUCENE.getKey() |
static ResultCache |
NOP_RESULT_CACHE
A result cache which doesn't do any caching |
static org.apache.log4j.Logger |
s_log
|
static String |
XML_NS
Constant for search XML namespace URL |
static String |
XML_PREFIX
Constant for serach XML namespace prefix |
| Constructor Summary | |
Search()
|
|
| Method Summary | |
static SearchConfig |
getConfig()
Retrieves the current serach configuration |
static Element |
newElement(String name)
Creates a new element in the search XML namespace, prepending the default search namespace prefix. |
static ResultSet |
process(QuerySpecification spec)
Processes a query specification, returning a cached document result set. |
static ResultSet |
process(QuerySpecification spec,
ResultCache cache)
Processes a query specification, returning a cached document result set. |
static ResultSet |
process(QuerySpecification spec,
ResultCache cache,
String engine)
Processes a query specification, returning a cached document result set. |
static ResultSet |
processInternal(QuerySpecification spec,
String engine)
Processes a query specification, returning a document result set with no caching. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final org.apache.log4j.Logger s_log
public static final ResultSet EMPTY_RESULT_SET
public static final long CACHE_LIFETIME
public static final long CACHE_SIZE
public static final int CACHE_DOCUMENT_COUNT
public static final ResultCache NOP_RESULT_CACHE
public static final ResultCache DEFAULT_RESULT_CACHE
public static final String INDEXER_INTERMEDIA
public static final String INDEXER_LUCENE
public static final String XML_PREFIX
public static final String XML_NS
| Constructor Detail |
public Search()
| Method Detail |
public static SearchConfig getConfig()
public static ResultSet process(QuerySpecification spec)
spec - the query specification
public static ResultSet process(QuerySpecification spec,
ResultCache cache)
spec - the query specificationcache - the result cache to use
public static ResultSet process(QuerySpecification spec,
ResultCache cache,
String engine)
spec - the query specificationcache - the result cache to useengine - the query engine to use
public static ResultSet processInternal(QuerySpecification spec,
String engine)
spec - the query specificationengine - the query engine to use
public static Element newElement(String name)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||