Open
Description
- Package Name: @azure/search-documents
- Package Version: 12.1.0
- Operating system: Mac os
- nodejs
- version: 22
- browser
- name/version:
- typescript
- version: ^5
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://learn.microsoft.com
Describe the bug
Trying to use the documentation but I have ts errors
To Reproduce
Steps to reproduce the behavior:
- Install the package
import {
AzureKeyCredential,
SearchClient,
SearchIndexClient,
} from "@azure/search-documents"
const indexClient = new SearchIndexClient(
"asd",
new AzureKeyCredential("asd")
)
async function main() {
const result = await indexClient.createIndex({
name: "documents",
fields: [
{
type: "Edm.String",
name: "id",
key: true,
},
{
type: "Edm.String",
name: "segmentId",
},
{
type: "Edm.String",
name: "content",
searchable: true,
},
{
name: "vector",
type: "Collection(Edm.Single)",
searchable: true,
retrievable: false,
stored: false,
dimensions: 1536,
vectorSearchProfile: "vector-profile-1",
},
{
type: "Edm.ComplexType",
name: "metadata",
fields: [
{
type: "Collection(Edm.String)",
name: "tags",
searchable: true,
},
],
},
{
type: "Edm.Int32",
name: "hiddenWeight",
hidden: true,
},
],
vectorSearch: {
compressions: [
{
name: "scalar-quantization",
kind: "scalarQuantization",
rerankWithOriginalVectors: true,
defaultOversampling: 10.0,
scalarQuantizationParameters: {
quantizedDataType: "int8",
},
},
{
name: "binary-quantization",
kind: "binaryQuantization",
rerankWithOriginalVectors: true,
defaultOversampling: 10.0,
},
],
algorithms: [
{
name: "hnsw-1",
kind: "hnsw",
hnswParameters: {
m: 4,
efConstruction: 400,
efSearch: 500,
metric: "cosine",
},
},
{
name: "hnsw-2",
kind: "hnsw",
hnswParameters: {
m: 8,
efConstruction: 800,
efSearch: 800,
metric: "hamming",
},
},
{
name: "eknn",
kind: "exhaustiveKnn",
exhaustiveKnnParameters: {
metric: "euclidean",
},
},
],
profiles: [
{
name: "vector-profile-hnsw-scalar",
compression: "scalar-quantization",
algorithm: "hnsw-1",
},
],
},
})
console.log(result)
}
main()
Expected behavior
The code copied and pasted from the doc should not have ts errors
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Thanks a lot

