Class LuceneIndexServiceBase
- java.lang.Object
-
- org.jboss.windup.maven.nexusindexer.client.LuceneIndexServiceBase
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class LuceneIndexServiceBase extends Object implements Closeable
- Author:
- Ondrej Zizka, zizka@seznam.cz
-
-
Constructor Summary
Constructors Constructor Description LuceneIndexServiceBase(File directory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidfindByField(String fieldName, String value, int maxHits, org.jboss.windup.maven.nexusindexer.ZipUtil.Visitor<org.apache.lucene.document.Document> visitor)Visits each document having @fieldName field with @value using given visitor.<T> TfindSingle(String fieldName, String value, DocTo<T> converter)Visits each document having @fieldName field with @value using given visitor.FilegetDirectory()org.apache.lucene.search.IndexSearchergetSearcher()intvisitAllDocuments(org.jboss.windup.maven.nexusindexer.ZipUtil.Visitor<org.apache.lucene.document.Document> visitor)
-
-
-
Field Detail
-
directory
protected File directory
-
index
protected org.apache.lucene.store.Directory index
-
reader
protected org.apache.lucene.index.IndexReader reader
-
searcher
protected org.apache.lucene.search.IndexSearcher searcher
-
-
Constructor Detail
-
LuceneIndexServiceBase
public LuceneIndexServiceBase(File directory)
-
-
Method Detail
-
close
public final void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
visitAllDocuments
public int visitAllDocuments(org.jboss.windup.maven.nexusindexer.ZipUtil.Visitor<org.apache.lucene.document.Document> visitor)
-
findByField
public void findByField(String fieldName, String value, int maxHits, org.jboss.windup.maven.nexusindexer.ZipUtil.Visitor<org.apache.lucene.document.Document> visitor)
Visits each document having @fieldName field with @value using given visitor.- Parameters:
maxHits- Maximum number of top matching documents to visit.
-
findSingle
public <T> T findSingle(String fieldName, String value, DocTo<T> converter)
Visits each document having @fieldName field with @value using given visitor.
-
getSearcher
public final org.apache.lucene.search.IndexSearcher getSearcher()
-
getDirectory
public final File getDirectory()
-
-