Class StorePruningPolicy


  • public class StorePruningPolicy
    extends PruningPolicy
    Pruning policy for removing stored fields from documents.
    • 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