org.hibernate.search.query.fieldcache.impl
Interface FieldLoadingStrategy

All Known Implementing Classes:
DoubleFieldLoadingStrategy, FloatFieldLoadingStrategy, IntFieldLoadingStrategy, LongFieldLoadingStrategy, StringFieldLoadingStrategy

public interface FieldLoadingStrategy

Using as composition in implementations of query.collector.FieldCacheCollector, so that we can reuse different loading strategies in different kinds of Collectors.

Author:
Sanne Grinovero (C) 2011 Red Hat Inc.
See Also:
query.collector.BigArrayFieldCacheCollectorImpl, query.collector.MapFieldCacheCollectorImpl

Method Summary
 Object collect(int relativeDocId)
          The collector wants to pick a specific element from the cache.
 void loadNewCacheValues(org.apache.lucene.index.IndexReader reader)
          A new IndexReader is opened - implementations usually need this to load the next array of cached data.
 

Method Detail

loadNewCacheValues

void loadNewCacheValues(org.apache.lucene.index.IndexReader reader)
                        throws IOException
A new IndexReader is opened - implementations usually need this to load the next array of cached data.

Parameters:
reader - the IndexReader for which to load the new cache values
Throws:
IOException - in case an error occurs reading the cache values from the index

collect

Object collect(int relativeDocId)
The collector wants to pick a specific element from the cache. Only at this point we convert primitives into an object if needed.

Parameters:
relativeDocId - the doc id relative to the current reader
Returns:
the cached field value for the document with the relative id relativeDocId.


Copyright © 2006-2013 Red Hat Middleware, LLC. All Rights Reserved