Package org.apache.lucene.index
Class PayloadProcessorProvider
- java.lang.Object
-
- org.apache.lucene.index.PayloadProcessorProvider
-
public abstract class PayloadProcessorProvider extends Object
Provides aPayloadProcessorProvider.ReaderPayloadProcessor
to be used for aDirectory
. This allows using differentPayloadProcessorProvider.ReaderPayloadProcessor
s for different sourceIndexReader
, for e.g. to perform different processing of payloads of different directories.NOTE: to avoid processing payloads of certain directories, you can return
null
ingetReaderProcessor(org.apache.lucene.index.IndexReader)
.NOTE: it is possible that the same
PayloadProcessorProvider.ReaderPayloadProcessor
will be requested for the sameDirectory
concurrently. Therefore, to avoid concurrency issues you should return different instances for different threads. Usually, if yourPayloadProcessorProvider.ReaderPayloadProcessor
does not maintain state this is not a problem. The merge code ensures that thePayloadProcessorProvider.ReaderPayloadProcessor
instance you return will be accessed by one thread to obtain thePayloadProcessorProvider.PayloadProcessor
s for different terms.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PayloadProcessorProvider.DirPayloadProcessor
Deprecated.UsePayloadProcessorProvider.ReaderPayloadProcessor
instead.static class
PayloadProcessorProvider.PayloadProcessor
Processes the given payload.static class
PayloadProcessorProvider.ReaderPayloadProcessor
Returns aPayloadProcessorProvider.PayloadProcessor
for a givenTerm
which allows processing the payloads of different terms differently.
-
Constructor Summary
Constructors Constructor Description PayloadProcessorProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PayloadProcessorProvider.DirPayloadProcessor
getDirProcessor(Directory dir)
Deprecated.PayloadProcessorProvider.ReaderPayloadProcessor
getReaderProcessor(IndexReader reader)
Returns aPayloadProcessorProvider.ReaderPayloadProcessor
for the givenDirectory
, through whichPayloadProcessorProvider.PayloadProcessor
s can be obtained for eachTerm
, ornull
if none should be used.
-
-
-
Method Detail
-
getReaderProcessor
public PayloadProcessorProvider.ReaderPayloadProcessor getReaderProcessor(IndexReader reader) throws IOException
Returns aPayloadProcessorProvider.ReaderPayloadProcessor
for the givenDirectory
, through whichPayloadProcessorProvider.PayloadProcessor
s can be obtained for eachTerm
, ornull
if none should be used. You should override this method, notgetDirProcessor(org.apache.lucene.store.Directory)
.- Throws:
IOException
-
getDirProcessor
@Deprecated public PayloadProcessorProvider.DirPayloadProcessor getDirProcessor(Directory dir) throws IOException
Deprecated.UsegetReaderProcessor(org.apache.lucene.index.IndexReader)
instead. You can still select byDirectory
, if you retrieve the underlying directory fromIndexReader.directory()
.Returns aPayloadProcessorProvider.DirPayloadProcessor
for the givenDirectory
, through whichPayloadProcessorProvider.PayloadProcessor
s can be obtained for eachTerm
, ornull
if none should be used.- Throws:
IOException
-
-