Skip to content

Commit b8d84c6

Browse files
authored
[Search] Enable vector compression tests (Azure#29596)
1 parent 4a10299 commit b8d84c6

File tree

4 files changed

+3
-28
lines changed

4 files changed

+3
-28
lines changed

sdk/search/search-documents/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "js",
44
"TagPrefix": "js/search/search-documents",
5-
"Tag": "js/search/search-documents_e4f423ced3"
5+
"Tag": "js/search/search-documents_8ce2647993"
66
}

sdk/search/search-documents/test/compressionDisabled.ts

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

sdk/search/search-documents/test/public/node/searchClient.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
} from "../../../src";
2020
import { SearchFieldArray, SelectArray } from "../../../src/indexModels";
2121
import { delay, serviceVersions } from "../../../src/serviceUtils";
22-
import { COMPRESSION_DISABLED } from "../../compressionDisabled";
2322
import { Hotel } from "../utils/interfaces";
2423
import { createClients } from "../utils/recordedClient";
2524
import { createIndex, createRandomIndexName, populateIndex, WAIT_TIME } from "../utils/setup";
@@ -597,10 +596,7 @@ versionsToTest(serviceVersions, {}, (serviceVersion, onVersions) => {
597596
if (isLiveMode()) {
598597
this.skip();
599598
}
600-
// Currently unable to create a compression resource
601-
if (COMPRESSION_DISABLED) {
602-
this.skip();
603-
}
599+
604600
const embeddings = await openAIClient.getEmbeddings(
605601
env.AZURE_OPENAI_DEPLOYMENT_NAME ?? "deployment-name",
606602
["What are the most luxurious hotels?"],

sdk/search/search-documents/test/public/utils/setup.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
SearchIndexerClient,
1414
} from "../../../src";
1515
import { delay } from "../../../src/serviceUtils";
16-
import { COMPRESSION_DISABLED } from "../../compressionDisabled";
1716
import { Hotel } from "./interfaces";
1817

1918
export const WAIT_TIME = isPlaybackMode() ? 0 : 4000;
@@ -312,20 +311,6 @@ export async function createIndex(
312311
},
313312
};
314313

315-
// This feature isn't publically available yet
316-
if (COMPRESSION_DISABLED) {
317-
hotelIndex.fields = hotelIndex.fields.filter(
318-
(field) => field.name !== "compressedVectorDescription",
319-
);
320-
const vs = hotelIndex.vectorSearch;
321-
if (vs) {
322-
delete vs.compressions;
323-
vs.profiles = vs.profiles?.filter(
324-
(profile) => profile.name !== compressedVectorSearchProfileName,
325-
);
326-
}
327-
}
328-
329314
await client.createIndex(hotelIndex);
330315
}
331316

@@ -568,9 +553,7 @@ async function addVectorDescriptions(
568553
const { embedding, index } = embeddingItem;
569554
const document = documents[index];
570555
document.vectorDescription = embedding;
571-
if (!COMPRESSION_DISABLED) {
572-
document.compressedVectorDescription = embedding;
573-
}
556+
document.compressedVectorDescription = embedding;
574557
});
575558
}
576559

0 commit comments

Comments
 (0)