public abstract class PayloadProcessorProvider extends Object
PayloadProcessorProvider.ReaderPayloadProcessor
to be used for a Directory
.
This allows using different PayloadProcessorProvider.ReaderPayloadProcessor
s for different
source IndexReader
, for e.g. to perform different processing of payloads of
different directories.
NOTE: to avoid processing payloads of certain directories, you can
return null
in getReaderProcessor(org.apache.lucene.index.IndexReader)
.
NOTE: it is possible that the same PayloadProcessorProvider.ReaderPayloadProcessor
will be
requested for the same Directory
concurrently. Therefore, to avoid
concurrency issues you should return different instances for different
threads. Usually, if your PayloadProcessorProvider.ReaderPayloadProcessor
does not maintain state
this is not a problem. The merge code ensures that the
PayloadProcessorProvider.ReaderPayloadProcessor
instance you return will be accessed by one
thread to obtain the PayloadProcessorProvider.PayloadProcessor
s for different terms.
Modifier and Type | Class and Description |
---|---|
static class |
PayloadProcessorProvider.DirPayloadProcessor
Deprecated.
Use
PayloadProcessorProvider.ReaderPayloadProcessor instead. |
static class |
PayloadProcessorProvider.PayloadProcessor
Processes the given payload.
|
static class |
PayloadProcessorProvider.ReaderPayloadProcessor
Returns a
PayloadProcessorProvider.PayloadProcessor for a given Term which allows
processing the payloads of different terms differently. |
Constructor and Description |
---|
PayloadProcessorProvider() |
Modifier and Type | Method and Description |
---|---|
PayloadProcessorProvider.DirPayloadProcessor |
getDirProcessor(Directory dir)
Deprecated.
Use
getReaderProcessor(org.apache.lucene.index.IndexReader) instead. You can still select by Directory ,
if you retrieve the underlying directory from IndexReader.directory() . |
PayloadProcessorProvider.ReaderPayloadProcessor |
getReaderProcessor(IndexReader reader)
Returns a
PayloadProcessorProvider.ReaderPayloadProcessor for the given Directory ,
through which PayloadProcessorProvider.PayloadProcessor s can be obtained for each
Term , or null if none should be used. |
public PayloadProcessorProvider.ReaderPayloadProcessor getReaderProcessor(IndexReader reader) throws IOException
PayloadProcessorProvider.ReaderPayloadProcessor
for the given Directory
,
through which PayloadProcessorProvider.PayloadProcessor
s can be obtained for each
Term
, or null
if none should be used.
You should override this method, not getDirProcessor(org.apache.lucene.store.Directory)
.IOException
@Deprecated public PayloadProcessorProvider.DirPayloadProcessor getDirProcessor(Directory dir) throws IOException
getReaderProcessor(org.apache.lucene.index.IndexReader)
instead. You can still select by Directory
,
if you retrieve the underlying directory from IndexReader.directory()
.PayloadProcessorProvider.DirPayloadProcessor
for the given Directory
,
through which PayloadProcessorProvider.PayloadProcessor
s can be obtained for each
Term
, or null
if none should be used.IOException