java.lang.Object
org.apache.lucene.codecs.perfield.PerFieldMergeState
Utility class to update the
MergeState 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 ClassesModifier and TypeClassDescriptionprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MergeStateprivate final FieldInfos[]private final FieldsProducer[]private final FieldInfos -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) MergeStateapply(Collection<String> fields) Update the inputMergeStateinstance to restrict the fields to the given ones.(package private) MergeStatereset()Resets the inputMergeStateinstance to its original state.
-
Field Details
-
in
-
orgMergeFieldInfos
-
orgFieldInfos
-
orgFieldsProducers
-
-
Constructor Details
-
PerFieldMergeState
PerFieldMergeState(MergeState in)
-
-
Method Details
-
apply
Update the inputMergeStateinstance 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 inputMergeStateinstance to its original state.- Returns:
- The reset instance.
-