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.analysis.standard.StandardAnalyzer;
|
||||||
import org.apache.lucene.search.*;
|
import org.apache.lucene.search.*;
|
||||||
|
|
||||||
import search.SearchIndexer;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of {@link SearchService}.
|
* Implementation of {@link SearchService}.
|
||||||
* <p>
|
|
||||||
* <b>Note that this implementation uses code from
|
|
||||||
* /projects/appex/search.</b>
|
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public class LuceneSearchService
|
public class LuceneSearchService
|
||||||
extends org.apache.fulcrum.BaseService implements SearchService
|
extends org.apache.fulcrum.BaseService implements SearchService
|
||||||
|
@ -42,8 +36,7 @@ public class LuceneSearchService
|
||||||
|
|
||||||
public void init() throws InitializationException
|
public void init() throws InitializationException
|
||||||
{
|
{
|
||||||
searchIndexLocation = getConfiguration().getString(
|
searchIndexLocation = getConfiguration().getString(SearchService.INDEX_LOCATION_KEY);
|
||||||
SearchService.INDEX_LOCATION_KEY);
|
|
||||||
setInit(true);
|
setInit(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,19 +106,7 @@ public class LuceneSearchService
|
||||||
|
|
||||||
public void batchIndex() throws ServiceException
|
public void batchIndex() throws ServiceException
|
||||||
{
|
{
|
||||||
try
|
throw new UnsupportedOperationException();
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isIndexing()
|
public boolean isIndexing()
|
||||||
|
@ -155,41 +136,4 @@ public class LuceneSearchService
|
||||||
{
|
{
|
||||||
indexLocked = false;
|
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.log4j.Category;
|
||||||
import org.apache.lucene.document.Document;
|
import org.apache.lucene.document.Document;
|
||||||
import org.apache.lucene.search.Hits;
|
import org.apache.lucene.search.Hits;
|
||||||
import search.SearchResultFactory;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -15,10 +14,6 @@ import java.io.IOException;
|
||||||
* SearchResults also provides a way of retrieving Java objects from
|
* SearchResults also provides a way of retrieving Java objects from
|
||||||
* Documents (via {@link search.SearchResultsFactory}).
|
* Documents (via {@link search.SearchResultsFactory}).
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
|
||||||
* <b>Note that this implementation uses code from
|
|
||||||
* /projects/appex/search.</b>
|
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public class SearchResults
|
public class SearchResults
|
||||||
{
|
{
|
||||||
|
@ -67,6 +62,11 @@ public class SearchResults
|
||||||
*/
|
*/
|
||||||
public Object[] getResultsAsObjects()
|
public Object[] getResultsAsObjects()
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* At this point, use some mechanism of retrieving
|
||||||
|
* the objects via a UUID or something.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
if (objectResults == null)
|
if (objectResults == null)
|
||||||
{
|
{
|
||||||
objectResults = new Object[hitsDocuments.length];
|
objectResults = new Object[hitsDocuments.length];
|
||||||
|
@ -83,6 +83,7 @@ public class SearchResults
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return objectResults;
|
return objectResults;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue