mirror of https://github.com/apache/lucene.git
Removed or otherwise commented out dependency on appex/Indyo.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150836 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
155bd6618e
commit
5cf76aa76a
|
@ -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}.
|
||||
* <p>
|
||||
* <b>Note that this implementation uses code from
|
||||
* /projects/appex/search.</b>
|
||||
* </p>
|
||||
*/
|
||||
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()
|
||||
|
@ -156,40 +137,3 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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}).
|
||||
* </p>
|
||||
* <p>
|
||||
* <b>Note that this implementation uses code from
|
||||
* /projects/appex/search.</b>
|
||||
* </p>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue