From 5ab813ac7224556f8b2b087bd2e65f4a62e385bc Mon Sep 17 00:00:00 2001 From: Kelvin Tan Date: Sat, 11 May 2002 00:46:14 +0000 Subject: [PATCH] Fulcrum-based service declaration of a search service. This is actually quite a Lucene-specific interface declaration. git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150767 13f79535-47bb-0310-9956-ffa450edef68 --- .../contributions/fulcrum/SearchService.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sandbox/contributions/fulcrum/SearchService.java diff --git a/sandbox/contributions/fulcrum/SearchService.java b/sandbox/contributions/fulcrum/SearchService.java new file mode 100644 index 00000000000..e8e05a2684f --- /dev/null +++ b/sandbox/contributions/fulcrum/SearchService.java @@ -0,0 +1,72 @@ +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.search.Filter; +import org.apache.lucene.search.Query; +import org.apache.lucene.document.Document; +import org.apache.fulcrum.ServiceException; +import org.apache.fulcrum.Service; + +import java.util.Map; + +/** + * A SearchService based on the Fulcrum services framework. + */ +public interface SearchService extends Service +{ + /** + * The key in the TurbineResources.properties that references this + * service. + */ + public static final String SERVICE_NAME = "SearchService"; + + /** + * The key in SearchService properties in + * TurbineResources.properties. The location of the index. + * Assumes a FSDirectory is used. + */ + public static final String INDEX_LOCATION_KEY = "index.location"; + + /** + * Performs a search. + * + * @param Query to search on. + * @return SearchResults + * @exception ServiceException + */ + public SearchResults search(Query query) throws ServiceException; + + /** + * Performs a search, using a filter to filter the results. + * + * @param Query to search on. + * @param Filter to filter the results through. + * @return SearchResults + * @exception ServiceException + */ + public SearchResults search(Query query, Filter filter) throws ServiceException; + + /** + * Performs a search, using a filter to filter the results, then + * return the results within the range specified. + * + * @param Query to search on. + * @return SearchResults + * @exception ServiceException + */ + public SearchResults search(Query query, Filter filter, + int from, int to) throws ServiceException; + + /** + * Refresh the entire index. + */ + public void batchIndex() throws ServiceException; + + /** + * Is the indexer currently indexing? + */ + public boolean isIndexing(); + + /** + * Get the analyzer used. + */ + public Analyzer getAnalyzer(); +}