Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
7.4, 7.5
-
New
Description
The indexing time for my ~2M documents has gone up significantly when I started adding fields of type NumericDocValuesField.
Upon debugging found the bottleneck to be in the PerFieldMergeState#FilterFieldInfos constructor. The contains check in the below code snippet was the culprit.
this.filteredNames = new HashSet<>(filterFields); this.filtered = new ArrayList<>(filterFields.size()); for (FieldInfo fi : src) { if (filterFields.contains(fi.name)) {
A simple change as below seems to have fixed my issue
this.filteredNames = new HashSet<>(filterFields); this.filtered = new ArrayList<>(filterFields.size()); for (FieldInfo fi : src) { if (this.filteredNames.contains(fi.name)) {