Class StringFieldLoadingStrategy

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

public final class StringFieldLoadingStrategy 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. This particular implementation doesn't do any conversion.
See Also:
  • Constructor Details

    • StringFieldLoadingStrategy

      public StringFieldLoadingStrategy(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 String 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.