File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
server/src/main/java/org/elasticsearch/index/codec Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ static final class TrackingLengthFieldsConsumer extends FieldsConsumer {
7070 this .state = state ;
7171 this .in = in ;
7272 this .totalBytes = new long [1 ];
73+ // Alternatively, we can consider using a FixedBitSet here and size to max(fieldNumber). T
74+ // his should be faster without worrying too much about memory usage.
7375 this .seenFields = new IntHashSet (state .fieldInfos .size ());
7476 }
7577
@@ -107,6 +109,8 @@ public Terms terms(String field) throws IOException {
107109 if (seenFields .add (fieldNum )) {
108110 return new TrackingLengthTerms (terms , bytes -> totalBytes [0 ] += bytes );
109111 } else {
112+ // As far as I know only when bloom filter for _id filter gets written this method gets invoked twice for the same field.
113+ // So maybe we can get rid of the seenFields here? And just keep track of whether _id field has been seen?
110114 return terms ;
111115 }
112116 }
You can’t perform that action at this time.
0 commit comments