Class PerFieldMergeState
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 class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MergeState
private final FieldInfos[]
private final FieldsProducer[]
private final FieldInfos
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) MergeState
apply
(Collection<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 Details
-
in
-
orgMergeFieldInfos
-
orgFieldInfos
-
orgFieldsProducers
-
-
Constructor Details
-
PerFieldMergeState
PerFieldMergeState(MergeState in)
-
-
Method Details
-
apply
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.
-