Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.index.pruning
Class StorePruningPolicy

    java.lang.Object
      org.apache.lucene.index.pruning.PruningPolicy
          org.apache.lucene.index.pruning.StorePruningPolicy

    public class StorePruningPolicy

extends PruningPolicy

Pruning policy for removing stored fields from documents.

Field Summary
`protected Set<String>` | `deleteAll` Fields to be completely deleted
`protected int` | `delFields`
`protected Map<String,Integer>` | `fieldFlags` Pruning in effect for each field
`protected org.apache.lucene.index.pruning.StorePruningPolicy.DelFieldSelector` | `fs`
`protected org.apache.lucene.index.IndexReader` | `in`

Fields inherited from class org.apache.lucene.index.pruning.PruningPolicy
`DEL_ALL, DEL_PAYLOADS, DEL_POSTINGS, DEL_STORED, DEL_VECTOR`

Constructor Summary
`StorePruningPolicy(org.apache.lucene.index.IndexReader in, Map<String,Integer> fieldFlags)` Constructs a policy.

Method Summary
`org.apache.lucene.index.FieldInfos` | `getFieldInfos(org.apache.lucene.index.FieldInfos allInfos)` Compute field infos that should be retained
`org.apache.lucene.document.Document` | `pruneDocument(int doc, org.apache.lucene.document.FieldSelector parent)` Prune stored fields of a document.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fieldFlags

    protected Map<String,Integer> fieldFlags

  Pruning in effect for each field

### deleteAll

    protected Set<String> deleteAll

  Fields to be completely deleted

### fs

    protected org.apache.lucene.index.pruning.StorePruningPolicy.DelFieldSelector fs

### in

    protected org.apache.lucene.index.IndexReader in

### delFields

    protected int delFields

Constructor Detail

### StorePruningPolicy

    public StorePruningPolicy(org.apache.lucene.index.IndexReader in,
                              Map<String,Integer> fieldFlags)

  Constructs a policy.

  Parameters:
    `in` - input reader.
    `fieldFlags` - a map where keys are field names, and flags are bitwise-OR values of flags defined in `PruningPolicy`.

Method Detail

### getFieldInfos

    public org.apache.lucene.index.FieldInfos getFieldInfos(org.apache.lucene.index.FieldInfos allInfos)

  Compute field infos that should be retained

  Parameters:
    `allInfos` - original field infos
  Returns:
    those of the original field infos which should not be removed.

### pruneDocument

    public org.apache.lucene.document.Document pruneDocument(int doc,
                                                             org.apache.lucene.document.FieldSelector parent)
                                                      throws IOException

  Prune stored fields of a document. Note that you can also arbitrarily change values of the retrieved fields, so long as the field names belong to a list of fields returned from `getFieldInfos(FieldInfos)`.

  Parameters:
    `doc` - document number
    `parent` - original field selector that limits what fields will be retrieved.
  Returns:
    a pruned instance of a Document.
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD