public interface InitializationRequired
IndexReader
is required.
This is primarily intended for LuceneResultFilter
s
that need to be initialised with the same IndexReader
used by the search they will be participating in.
For example, a filter that performs filtering based on lucene document ID's can only be expected to operate correctly
if the document ID's don't change. This can only be guaranteed if the filter's view of the index is the same as the
IndexSearcher
. This can be achieved by ensuring the filter is initialised with the
same IndexReader
used by the search.
Intended usage: A LuceneResultFilter
that implements this interfacd, should have the same IndexReader
used by the search passed to it's init(org.apache.lucene.index.IndexReader)
method. The filter can then be
applied to the search and then discarded.
WARNING: A LuceneResultFilter
should not be re-used outside of the search it was created for.
Modifier and Type | Method and Description |
---|---|
void |
init(org.apache.lucene.index.IndexReader indexReader)
Performs initialisation of a result filter using the indexReader provided.
|
boolean |
isInitialized() |
void init(org.apache.lucene.index.IndexReader indexReader)
indexReader
- the indexReader owned by the IndexSearcher
used by the search.com.atlassian.bonnie.LuceneException
- if there are IO issues accessing the indexboolean isInitialized()
Copyright © 2003–2020 Atlassian. All rights reserved.