@@ -30,30 +30,32 @@ public class Elasticsearch814Codec extends CodecService.DeduplicateFieldInfosCod
30
30
31
31
private final StoredFieldsFormat storedFieldsFormat ;
32
32
33
- private final PostingsFormat defaultPostingsFormat ;
33
+ private static final PostingsFormat defaultPostingsFormat = new Lucene99PostingsFormat () ;
34
34
private final PostingsFormat postingsFormat = new PerFieldPostingsFormat () {
35
35
@ Override
36
36
public PostingsFormat getPostingsFormatForField (String field ) {
37
37
return Elasticsearch814Codec .this .getPostingsFormatForField (field );
38
38
}
39
39
};
40
40
41
- private final DocValuesFormat defaultDVFormat ;
41
+ private static final DocValuesFormat defaultDVFormat = new Lucene90DocValuesFormat () ;
42
42
private final DocValuesFormat docValuesFormat = new PerFieldDocValuesFormat () {
43
43
@ Override
44
44
public DocValuesFormat getDocValuesFormatForField (String field ) {
45
45
return Elasticsearch814Codec .this .getDocValuesFormatForField (field );
46
46
}
47
47
};
48
48
49
- private final KnnVectorsFormat defaultKnnVectorsFormat ;
49
+ private static final KnnVectorsFormat defaultKnnVectorsFormat = new Lucene99HnswVectorsFormat () ;
50
50
private final KnnVectorsFormat knnVectorsFormat = new PerFieldKnnVectorsFormat () {
51
51
@ Override
52
52
public KnnVectorsFormat getKnnVectorsFormatForField (String field ) {
53
53
return Elasticsearch814Codec .this .getKnnVectorsFormatForField (field );
54
54
}
55
55
};
56
56
57
+ private static final Lucene99Codec lucene99Codec = new Lucene99Codec ();
58
+
57
59
/** Public no-arg constructor, needed for SPI loading at read-time. */
58
60
public Elasticsearch814Codec () {
59
61
this (Zstd814StoredFieldsFormat .Mode .BEST_SPEED );
@@ -64,11 +66,8 @@ public Elasticsearch814Codec() {
64
66
* worse space-efficiency or vice-versa.
65
67
*/
66
68
public Elasticsearch814Codec (Zstd814StoredFieldsFormat .Mode mode ) {
67
- super ("Elasticsearch814" , new Lucene99Codec () );
69
+ super ("Elasticsearch814" , lucene99Codec );
68
70
this .storedFieldsFormat = new Zstd814StoredFieldsFormat (mode );
69
- this .defaultPostingsFormat = new Lucene99PostingsFormat ();
70
- this .defaultDVFormat = new Lucene90DocValuesFormat ();
71
- this .defaultKnnVectorsFormat = new Lucene99HnswVectorsFormat ();
72
71
}
73
72
74
73
@ Override
0 commit comments