org.apache.solr.uninverting

## Class UninvertingReader

- java.lang.Object
- - org.apache.lucene.index.IndexReader
  - - org.apache.lucene.index.LeafReader
    - - org.apache.lucene.index.FilterLeafReader
      - - org.apache.solr.uninverting.UninvertingReader

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class UninvertingReader
      extends FilterLeafReader

  A FilterReader that exposes indexed values as if they also had docvalues.

  This is accomplished by "inverting the inverted index" or "uninversion".

  The uninversion process happens lazily: upon the first request for the field's docvalues (e.g. via `LeafReader.getNumericDocValues(String)` or similar), it will create the docvalues on-the-fly if needed and cache it, based on the core cache key of the wrapped LeafReader.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `UninvertingReader.Type` Specifies the type of uninversion to apply for the field.

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.FilterLeafReader

      `FilterLeafReader.FilterFields, FilterLeafReader.FilterPostingsEnum, FilterLeafReader.FilterTerms, FilterLeafReader.FilterTermsEnum`

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.LeafReader

      `LeafReader.CoreClosedListener`

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader

      `IndexReader.ReaderClosedListener`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.index.FilterLeafReader

      `in`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UninvertingReader(LeafReader in, Map<String,UninvertingReader.Type> mapping)` Create a new UninvertingReader with the specified mapping

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BinaryDocValues` | `getBinaryDocValues(String field)`
    `Object` | `getCombinedCoreAndDeletesKey()`
    `Object` | `getCoreCacheKey()`
    `Bits` | `getDocsWithField(String field)`
    `FieldInfos` | `getFieldInfos()`
    `NumericDocValues` | `getNumericDocValues(String field)`
    `SortedDocValues` | `getSortedDocValues(String field)`
    `SortedSetDocValues` | `getSortedSetDocValues(String field)`
    `static String[]` | `getUninvertedStats()` Return information about the backing cache
    `static int` | `getUninvertedStatsSize()`
    `String` | `toString()`
    `static DirectoryReader` | `wrap(DirectoryReader in, Map<String,UninvertingReader.Type> mapping)` Wraps a provided DirectoryReader.

    - ### Methods inherited from class org.apache.lucene.index.FilterLeafReader

      `addCoreClosedListener, checkIntegrity, doClose, document, fields, getDelegate, getIndexSort, getLiveDocs, getNormValues, getPointValues, getSortedNumericDocValues, getTermVectors, maxDoc, numDocs, removeCoreClosedListener, unwrap`

    - ### Methods inherited from class org.apache.lucene.index.LeafReader

      `addCoreClosedListenerAsReaderClosedListener, docFreq, getContext, getDocCount, getSumDocFreq, getSumTotalTermFreq, postings, postings, removeCoreClosedListenerAsReaderClosedListener, terms, totalTermFreq`

    - ### Methods inherited from class org.apache.lucene.index.IndexReader

      `addReaderClosedListener, close, decRef, document, document, ensureOpen, equals, getRefCount, getTermVector, hasDeletions, hashCode, incRef, leaves, numDeletedDocs, registerParentReader, removeReaderClosedListener, tryIncRef`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UninvertingReader

          public UninvertingReader(LeafReader in,
                                   Map<String,UninvertingReader.Type> mapping)

      Create a new UninvertingReader with the specified mapping

      Expert: This should almost never be used. Use `wrap(DirectoryReader, Map)` instead.

      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

  - ### Method Detail

    - #### wrap

          public static DirectoryReader wrap(DirectoryReader in,
                                             Map<String,UninvertingReader.Type> mapping)
                                      throws IOException

      Wraps a provided DirectoryReader. Note that for convenience, the returned reader can be used normally (e.g. passed to `DirectoryReader.openIfChanged(DirectoryReader)`) and so on.
      Throws:
        `IOException`

    - #### getFieldInfos

          public FieldInfos getFieldInfos()

      Overrides:
        `getFieldInfos` in class `FilterLeafReader`

    - #### getNumericDocValues

          public NumericDocValues getNumericDocValues(String field)
                                               throws IOException

      Overrides:
        `getNumericDocValues` in class `FilterLeafReader`
      Throws:
        `IOException`

    - #### getBinaryDocValues

          public BinaryDocValues getBinaryDocValues(String field)
                                             throws IOException

      Overrides:
        `getBinaryDocValues` in class `FilterLeafReader`
      Throws:
        `IOException`

    - #### getSortedDocValues

          public SortedDocValues getSortedDocValues(String field)
                                             throws IOException

      Overrides:
        `getSortedDocValues` in class `FilterLeafReader`
      Throws:
        `IOException`

    - #### getSortedSetDocValues

          public SortedSetDocValues getSortedSetDocValues(String field)
                                                   throws IOException

      Overrides:
        `getSortedSetDocValues` in class `FilterLeafReader`
      Throws:
        `IOException`

    - #### getDocsWithField

          public Bits getDocsWithField(String field)
                                throws IOException

      Overrides:
        `getDocsWithField` in class `FilterLeafReader`
      Throws:
        `IOException`

    - #### getCoreCacheKey

          public Object getCoreCacheKey()

      Overrides:
        `getCoreCacheKey` in class `IndexReader`

    - #### getCombinedCoreAndDeletesKey

          public Object getCombinedCoreAndDeletesKey()

      Overrides:
        `getCombinedCoreAndDeletesKey` in class `IndexReader`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `FilterLeafReader`

    - #### getUninvertedStats

          public static String[] getUninvertedStats()

      Return information about the backing cache
      NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

    - #### getUninvertedStatsSize

          public static int getUninvertedStatsSize()

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.