Package 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
Fields Modifier and Type Field Description protected Set<String>deleteAllFields to be completely deletedprotected intdelFieldsprotected Map<String,Integer>fieldFlagsPruning in effect for each fieldprotected org.apache.lucene.index.pruning.StorePruningPolicy.DelFieldSelectorfsprotected IndexReaderin-
Fields inherited from class org.apache.lucene.index.pruning.PruningPolicy
DEL_ALL, DEL_PAYLOADS, DEL_POSTINGS, DEL_STORED, DEL_VECTOR
-
-
Constructor Summary
Constructors Constructor Description StorePruningPolicy(IndexReader in, Map<String,Integer> fieldFlags)Constructs a policy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldInfosgetFieldInfos(FieldInfos allInfos)Compute field infos that should be retainedDocumentpruneDocument(int doc, FieldSelector parent)Prune stored fields of a document.
-
-
-
Field Detail
-
fs
protected org.apache.lucene.index.pruning.StorePruningPolicy.DelFieldSelector fs
-
in
protected IndexReader in
-
delFields
protected int delFields
-
-
Constructor Detail
-
StorePruningPolicy
public StorePruningPolicy(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 inPruningPolicy.
-
-
Method Detail
-
getFieldInfos
public FieldInfos getFieldInfos(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 Document pruneDocument(int doc, 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 fromgetFieldInfos(FieldInfos).- Parameters:
doc- document numberparent- original field selector that limits what fields will be retrieved.- Returns:
- a pruned instance of a Document.
- Throws:
IOException
-
-