diff --git a/sandbox/contributions/fulcrum/LuceneSearchService.java b/sandbox/contributions/fulcrum/LuceneSearchService.java index 9d582a42116..09c7f5ea57e 100644 --- a/sandbox/contributions/fulcrum/LuceneSearchService.java +++ b/sandbox/contributions/fulcrum/LuceneSearchService.java @@ -5,16 +5,10 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.search.*; -import search.SearchIndexer; - import java.io.IOException; /** * Implementation of {@link SearchService}. - *
- * Note that this implementation uses code from - * /projects/appex/search. - *
*/ public class LuceneSearchService extends org.apache.fulcrum.BaseService implements SearchService @@ -42,8 +36,7 @@ public class LuceneSearchService public void init() throws InitializationException { - searchIndexLocation = getConfiguration().getString( - SearchService.INDEX_LOCATION_KEY); + searchIndexLocation = getConfiguration().getString(SearchService.INDEX_LOCATION_KEY); setInit(true); } @@ -113,19 +106,7 @@ public class LuceneSearchService public void batchIndex() throws ServiceException { - try - { - acquireIndexLock(); - new IndexerThread(new SearchIndexer(), this); - } - catch (IOException ioe) - { - throw new ServiceException("Error encountered indexing!", ioe); - } - catch (InterruptedException ie) - { - throw new ServiceException("Error encountered indexing!", ie); - } + throw new UnsupportedOperationException(); } public boolean isIndexing() @@ -155,41 +136,4 @@ public class LuceneSearchService { indexLocked = false; } -} - -class IndexerThread extends Thread -{ - private static Category cat = Category.getInstance(IndexerThread.class); - - private SearchIndexer indexer; - private LuceneSearchService service; - - public IndexerThread() - { - super(); - } - - public IndexerThread(SearchIndexer indexer, LuceneSearchService service) - throws InterruptedException - { - service.acquireIndexLock(); - this.indexer = indexer; - start(); - } - - public void run() - { - try - { - indexer.index(); - } - catch (Exception e) - { - cat.error("Error indexing: " + e.getMessage(), e); - } - finally - { - service.releaseIndexLock(); - } - } } \ No newline at end of file diff --git a/sandbox/contributions/fulcrum/SearchResults.java b/sandbox/contributions/fulcrum/SearchResults.java index 2412edef2c9..3b6b0566d72 100644 --- a/sandbox/contributions/fulcrum/SearchResults.java +++ b/sandbox/contributions/fulcrum/SearchResults.java @@ -1,7 +1,6 @@ import org.apache.log4j.Category; import org.apache.lucene.document.Document; import org.apache.lucene.search.Hits; -import search.SearchResultFactory; import java.io.IOException; @@ -15,10 +14,6 @@ import java.io.IOException; * SearchResults also provides a way of retrieving Java objects from * Documents (via {@link search.SearchResultsFactory}). * - *- * Note that this implementation uses code from - * /projects/appex/search. - *
*/ public class SearchResults { @@ -67,6 +62,11 @@ public class SearchResults */ public Object[] getResultsAsObjects() { + /** + * At this point, use some mechanism of retrieving + * the objects via a UUID or something. + */ + /* if (objectResults == null) { objectResults = new Object[hitsDocuments.length]; @@ -83,6 +83,7 @@ public class SearchResults } } } + */ return objectResults; } }