Class PerFieldMergeState
- java.lang.Object
-
- org.apache.lucene.codecs.perfield.PerFieldMergeState
-
final class PerFieldMergeState extends java.lang.Object
Utility class to update theMergeState
instance to be restricted to a set of fields.Warning: the input MergeState instance will be updated when calling
apply(Collection)
.It should be called within a
try {...} finally {...}
block to make sure that the mergeState instance is restored to its original state:PerFieldMergeState pfMergeState = new PerFieldMergeState(mergeState); try { doSomething(pfMergeState.apply(fields)); ... } finally { pfMergeState.reset(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PerFieldMergeState.FilterFieldInfos
private static class
PerFieldMergeState.FilterFieldsProducer
-
Field Summary
Fields Modifier and Type Field Description private MergeState
in
private FieldInfos[]
orgFieldInfos
private FieldsProducer[]
orgFieldsProducers
private FieldInfos
orgMergeFieldInfos
-
Constructor Summary
Constructors Constructor Description PerFieldMergeState(MergeState in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) MergeState
apply(java.util.Collection<java.lang.String> fields)
Update the inputMergeState
instance to restrict the fields to the given ones.(package private) MergeState
reset()
Resets the inputMergeState
instance to its original state.
-
-
-
Field Detail
-
in
private final MergeState in
-
orgMergeFieldInfos
private final FieldInfos orgMergeFieldInfos
-
orgFieldInfos
private final FieldInfos[] orgFieldInfos
-
orgFieldsProducers
private final FieldsProducer[] orgFieldsProducers
-
-
Constructor Detail
-
PerFieldMergeState
PerFieldMergeState(MergeState in)
-
-
Method Detail
-
apply
MergeState apply(java.util.Collection<java.lang.String> fields)
Update the inputMergeState
instance to restrict the fields to the given ones.- Parameters:
fields
- The fields to keep in the updated instance.- Returns:
- The updated instance.
-
reset
MergeState reset()
Resets the inputMergeState
instance to its original state.- Returns:
- The reset instance.
-
-