com.atlassian.confluence.search.v2.lucene.resultfilter
Interface InitializationRequired

All Known Implementing Classes:
LuceneHandleBasedSubsetResultFilter

public interface InitializationRequired

An interface to indicate that post initialization with an IndexReader is required.

This is primarily intended for LuceneResultFilters 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.


Method Summary
 void init(org.apache.lucene.index.IndexReader indexReader)
          Performs initialisation of a result filter using the indexReader provided.
 boolean isInitialized()
           
 

Method Detail

init

void init(org.apache.lucene.index.IndexReader indexReader)
Performs initialisation of a result filter using the indexReader provided.

Parameters:
indexReader - the indexReader owned by the IndexSearcher used by the search.
Throws:
com.atlassian.bonnie.LuceneException - if there are IO issues accessing the index

isInitialized

boolean isInitialized()
Returns:
true if initialisation succeeded, false otherwise.


Copyright © 2003-2011 Atlassian. All Rights Reserved.