Package org.apache.lucene.index
Class PayloadProcessorProvider
- java.lang.Object
-
- org.apache.lucene.index.PayloadProcessorProvider
-
public abstract class PayloadProcessorProvider extends Object
Provides aPayloadProcessorProvider.ReaderPayloadProcessorto be used for aDirectory. This allows using differentPayloadProcessorProvider.ReaderPayloadProcessors 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
nullingetReaderProcessor(org.apache.lucene.index.IndexReader).NOTE: it is possible that the same
PayloadProcessorProvider.ReaderPayloadProcessorwill be requested for the sameDirectoryconcurrently. Therefore, to avoid concurrency issues you should return different instances for different threads. Usually, if yourPayloadProcessorProvider.ReaderPayloadProcessordoes not maintain state this is not a problem. The merge code ensures that thePayloadProcessorProvider.ReaderPayloadProcessorinstance you return will be accessed by one thread to obtain thePayloadProcessorProvider.PayloadProcessors 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 classPayloadProcessorProvider.DirPayloadProcessorDeprecated.UsePayloadProcessorProvider.ReaderPayloadProcessorinstead.static classPayloadProcessorProvider.PayloadProcessorProcesses the given payload.static classPayloadProcessorProvider.ReaderPayloadProcessorReturns aPayloadProcessorProvider.PayloadProcessorfor a givenTermwhich 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.DirPayloadProcessorgetDirProcessor(Directory dir)Deprecated.PayloadProcessorProvider.ReaderPayloadProcessorgetReaderProcessor(IndexReader reader)Returns aPayloadProcessorProvider.ReaderPayloadProcessorfor the givenDirectory, through whichPayloadProcessorProvider.PayloadProcessors can be obtained for eachTerm, ornullif none should be used.
-
-
-
Method Detail
-
getReaderProcessor
public PayloadProcessorProvider.ReaderPayloadProcessor getReaderProcessor(IndexReader reader) throws IOException
Returns aPayloadProcessorProvider.ReaderPayloadProcessorfor the givenDirectory, through whichPayloadProcessorProvider.PayloadProcessors can be obtained for eachTerm, ornullif 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.DirPayloadProcessorfor the givenDirectory, through whichPayloadProcessorProvider.PayloadProcessors can be obtained for eachTerm, ornullif none should be used.- Throws:
IOException
-
-