Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native engine vector format test #2103

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
public class NativeEngines990KnnVectorsFormatTests extends KNNTestCase {
private static final Codec TESTING_CODEC = new UnitTestCodec();
private static final String FLAT_VECTOR_FILE_EXT = ".vec";
private static final String HNSW_FILE_EXT = ".hnsw";
private static final String FAISS_ENGINE_FILE_EXT = ".faiss";
private static final String FLOAT_VECTOR_FIELD = "float_field";
private static final String FLOAT_VECTOR_FIELD_BINARY = "float_field_binary";
private static final String FLOAT_VECTOR_FIELD_BINARY = "float_binary_field";
private static final String BYTE_VECTOR_FIELD = "byte_field";
private Directory dir;
private RandomIndexWriter indexWriter;
Expand Down Expand Up @@ -220,11 +220,11 @@ public void testNativeEngineVectorFormat_whenMultipleVectorFieldIndexed_thenSucc
IndexSearcher searcher = new IndexSearcher(indexReader);
final LeafReader leafReader = searcher.getLeafContexts().get(0).reader();
SegmentReader segmentReader = Lucene.segmentReader(leafReader);
final List<String> hnswfiles = getFilesFromSegment(dir, HNSW_FILE_EXT);
// 0 hnsw files for now as we have not integrated graph creation here.
assertEquals(0, hnswfiles.size());
assertEquals(hnswfiles.stream().filter(x -> x.contains(FLOAT_VECTOR_FIELD)).count(), 0);
assertEquals(hnswfiles.stream().filter(x -> x.contains(BYTE_VECTOR_FIELD)).count(), 0);
final List<String> hnswfiles = getFilesFromSegment(dir, FAISS_ENGINE_FILE_EXT);
assertEquals(3, hnswfiles.size());
assertEquals(hnswfiles.stream().filter(x -> x.contains(FLOAT_VECTOR_FIELD)).count(), 1);
assertEquals(hnswfiles.stream().filter(x -> x.contains(BYTE_VECTOR_FIELD)).count(), 1);
assertEquals(hnswfiles.stream().filter(x -> x.contains(FLOAT_VECTOR_FIELD_BINARY)).count(), 1);

// Even setting IWC to not use compound file it still uses compound file, hence ensuring we don't check .vec
// file in case segment uses compound format. use this seed once we fix this to validate everything is
Expand Down
Loading