Class LongFieldLoadingStrategy

java.lang.Object
org.hibernate.search.query.fieldcache.LongFieldLoadingStrategy
All Implemented Interfaces:
FieldLoadingStrategy

public final class LongFieldLoadingStrategy extends Object implements FieldLoadingStrategy
We need a collection of similar implementations, one per each FieldCache.DEFAULT.accessmethod to be able to deal with arrays of primitive values without autoboxing all of them.
See Also:
  • Constructor Details

    • LongFieldLoadingStrategy

      public LongFieldLoadingStrategy(String fieldName)
  • Method Details

    • loadNewCacheValues

      public void loadNewCacheValues(IndexReader reader) throws IOException
      Description copied from interface: FieldLoadingStrategy
      A new IndexReader is opened - implementations usually need this to load the next array of cached data.
      Specified by:
      loadNewCacheValues in interface FieldLoadingStrategy
      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

      public Long collect(int relativeDocId)
      Description copied from interface: FieldLoadingStrategy
      The collector wants to pick a specific element from the cache. Only at this point we convert primitives into an object if needed.
      Specified by:
      collect in interface FieldLoadingStrategy
      Parameters:
      relativeDocId - the doc id relative to the current reader
      Returns:
      the cached field value for the document with the relative id relativeDocId.