Skip to content

Commit 684fa58

Browse files
committed
Don't use the new formats at the moment
1 parent a675520 commit 684fa58

File tree

8 files changed

+9
-35
lines changed

8 files changed

+9
-35
lines changed

qa/vector/src/main/java/org/elasticsearch/test/knn/KnnIndexTester.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.elasticsearch.index.codec.vectors.ES814HnswScalarQuantizedVectorsFormat;
3333
import org.elasticsearch.index.codec.vectors.diskbbq.ES920DiskBBQVectorsFormat;
3434
import org.elasticsearch.index.codec.vectors.es818.ES818BinaryQuantizedVectorsFormat;
35-
import org.elasticsearch.index.codec.vectors.es93.ES93HnswBinaryQuantizedVectorsFormat;
35+
import org.elasticsearch.index.codec.vectors.es818.ES818HnswBinaryQuantizedVectorsFormat;
3636
import org.elasticsearch.logging.Level;
3737
import org.elasticsearch.logging.LogManager;
3838
import org.elasticsearch.logging.Logger;
@@ -127,7 +127,7 @@ static Codec createCodec(CmdLineArgs args) {
127127
if (args.indexType() == IndexType.FLAT) {
128128
format = new ES818BinaryQuantizedVectorsFormat();
129129
} else {
130-
format = new ES93HnswBinaryQuantizedVectorsFormat(args.hnswM(), args.hnswEfConstruction(), 1, null);
130+
format = new ES818HnswBinaryQuantizedVectorsFormat(args.hnswM(), args.hnswEfConstruction(), 1, null);
131131
}
132132
} else if (args.quantizeBits() < 32) {
133133
if (args.indexType() == IndexType.FLAT) {

server/src/internalClusterTest/java/org/elasticsearch/index/store/DirectIOIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ static void assertBBQIndexType(String indexName, String type) {
113113
}
114114

115115
@TestLogging(value = "org.elasticsearch.index.store.FsDirectoryFactory:DEBUG", reason = "to capture trace logging for direct IO")
116+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/134479")
116117
public void testDirectIOUsed() {
117118
try (MockLog mockLog = MockLog.capture(FsDirectoryFactory.class)) {
118119
// we're just looking for some evidence direct IO is used (or not)

server/src/main/java/org/elasticsearch/index/codec/vectors/es818/ES818HnswBinaryQuantizedVectorsFormat.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.lucene.codecs.KnnVectorsWriter;
2424
import org.apache.lucene.codecs.hnsw.FlatVectorsFormat;
2525
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsReader;
26+
import org.apache.lucene.codecs.lucene99.Lucene99HnswVectorsWriter;
2627
import org.apache.lucene.index.SegmentReadState;
2728
import org.apache.lucene.index.SegmentWriteState;
2829
import org.elasticsearch.index.codec.vectors.AbstractHnswVectorsFormat;
@@ -76,7 +77,7 @@ protected FlatVectorsFormat flatVectorsFormat() {
7677

7778
@Override
7879
public KnnVectorsWriter fieldsWriter(SegmentWriteState state) throws IOException {
79-
throw new UnsupportedOperationException();
80+
return new Lucene99HnswVectorsWriter(state, maxConn, beamWidth, flatVectorsFormat.fieldsWriter(state), numMergeWorkers, mergeExec);
8081
}
8182

8283
@Override

server/src/main/java/org/elasticsearch/index/codec/vectors/es93/DirectIOCapableLucene99FlatVectorsFormat.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.apache.lucene.store.IOContext;
2020
import org.apache.lucene.store.MergeInfo;
2121
import org.elasticsearch.common.util.set.Sets;
22-
import org.elasticsearch.index.codec.vectors.AbstractFlatVectorsFormat;
2322
import org.elasticsearch.index.codec.vectors.DirectIOCapableFlatVectorsFormat;
2423
import org.elasticsearch.index.codec.vectors.MergeReaderWrapper;
2524
import org.elasticsearch.index.codec.vectors.es818.DirectIOHint;

server/src/main/java/org/elasticsearch/index/codec/vectors/es93/ES93BinaryQuantizedVectorsFormat.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.apache.lucene.codecs.hnsw.FlatVectorsWriter;
2626
import org.apache.lucene.index.SegmentReadState;
2727
import org.apache.lucene.index.SegmentWriteState;
28-
import org.elasticsearch.index.codec.vectors.AbstractFlatVectorsFormat;
2928
import org.elasticsearch.index.codec.vectors.DirectIOCapableFlatVectorsFormat;
3029
import org.elasticsearch.index.codec.vectors.OptimizedScalarQuantizer;
3130
import org.elasticsearch.index.codec.vectors.es818.ES818BinaryFlatVectorsScorer;
@@ -87,7 +86,7 @@
8786
* <li>The sparse vector information, if required, mapping vector ordinal to doc ID
8887
* </ul>
8988
*/
90-
public class ES93BinaryQuantizedVectorsFormat extends AbstractFlatVectorsFormat implements DirectIOCapableFlatVectorsFormat {
89+
public class ES93BinaryQuantizedVectorsFormat extends DirectIOCapableFlatVectorsFormat {
9190

9291
public static final String NAME = "ES93BinaryQuantizedVectorsFormat";
9392

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import org.elasticsearch.index.codec.vectors.ES815HnswBitVectorsFormat;
5555
import org.elasticsearch.index.codec.vectors.diskbbq.ES920DiskBBQVectorsFormat;
5656
import org.elasticsearch.index.codec.vectors.es818.ES818BinaryQuantizedVectorsFormat;
57-
import org.elasticsearch.index.codec.vectors.es93.ES93HnswBinaryQuantizedVectorsFormat;
57+
import org.elasticsearch.index.codec.vectors.es818.ES818HnswBinaryQuantizedVectorsFormat;
5858
import org.elasticsearch.index.fielddata.FieldDataContext;
5959
import org.elasticsearch.index.fielddata.IndexFieldData;
6060
import org.elasticsearch.index.mapper.ArraySourceValueFetcher;
@@ -2044,7 +2044,7 @@ public BBQHnswIndexOptions(int m, int efConstruction, RescoreVector rescoreVecto
20442044
@Override
20452045
KnnVectorsFormat getVectorsFormat(ElementType elementType) {
20462046
assert elementType == ElementType.FLOAT;
2047-
return new ES93HnswBinaryQuantizedVectorsFormat(m, efConstruction, onDiskRescore);
2047+
return new ES818HnswBinaryQuantizedVectorsFormat(m, efConstruction);
20482048
}
20492049

20502050
@Override

server/src/test/java/org/elasticsearch/index/codec/vectors/es818/ES818HnswBinaryQuantizedRWVectorsFormat.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

server/src/test/java/org/elasticsearch/index/codec/vectors/es818/ES818HnswBinaryQuantizedVectorsFormatTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public class ES818HnswBinaryQuantizedVectorsFormatTests extends BaseKnnVectorsFo
6464
LogConfigurator.configureESLogging(); // native access requires logging to be initialized
6565
}
6666

67-
static final Codec codec = TestUtil.alwaysKnnVectorsFormat(new ES818HnswBinaryQuantizedRWVectorsFormat());
67+
static final Codec codec = TestUtil.alwaysKnnVectorsFormat(new ES818HnswBinaryQuantizedVectorsFormat());
6868

6969
@Override
7070
protected Codec getCodec() {

0 commit comments

Comments
 (0)