@azure/search-documents 12.3.0-alpha.20260310.2 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/base64.d.ts.map +1 -1
- package/dist/browser/base64.js +3 -2
- package/dist/browser/base64.js.map +1 -1
- package/dist/browser/index.d.ts +9 -7
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +3 -4
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/indexModels.d.ts +13 -112
- package/dist/browser/indexModels.d.ts.map +1 -1
- package/dist/browser/indexModels.js.map +1 -1
- package/dist/browser/knowledgeBaseModels.d.ts +4 -17
- package/dist/browser/knowledgeBaseModels.d.ts.map +1 -1
- package/dist/browser/knowledgeBaseModels.js.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/index.d.ts +2 -1
- package/dist/browser/knowledgeBaseRetrieval/api/index.d.ts.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/index.js +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/index.js.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts +3 -1
- package/dist/browser/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js +3 -3
- package/dist/browser/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/operations.d.ts +2 -2
- package/dist/browser/knowledgeBaseRetrieval/api/operations.d.ts.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/operations.js +9 -8
- package/dist/browser/knowledgeBaseRetrieval/api/operations.js.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/options.d.ts +2 -2
- package/dist/browser/knowledgeBaseRetrieval/api/options.d.ts.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/api/options.js.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts +2 -2
- package/dist/browser/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts.map +1 -1
- package/dist/browser/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js +4 -4
- package/dist/browser/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js.map +1 -1
- package/dist/browser/knowledgeRetrievalClient.d.ts +2 -2
- package/dist/browser/knowledgeRetrievalClient.d.ts.map +1 -1
- package/dist/browser/knowledgeRetrievalClient.js +4 -4
- package/dist/browser/knowledgeRetrievalClient.js.map +1 -1
- package/dist/browser/models/azure/search/documents/index.d.ts +2 -1
- package/dist/browser/models/azure/search/documents/index.d.ts.map +1 -1
- package/dist/browser/models/azure/search/documents/index.js +1 -1
- package/dist/browser/models/azure/search/documents/index.js.map +1 -1
- package/dist/browser/models/azure/search/documents/indexes/index.d.ts +2 -1
- package/dist/browser/models/azure/search/documents/indexes/index.d.ts.map +1 -1
- package/dist/browser/models/azure/search/documents/indexes/index.js +1 -1
- package/dist/browser/models/azure/search/documents/indexes/index.js.map +1 -1
- package/dist/browser/models/azure/search/documents/indexes/models.d.ts +50 -477
- package/dist/browser/models/azure/search/documents/indexes/models.d.ts.map +1 -1
- package/dist/browser/models/azure/search/documents/indexes/models.js +40 -526
- package/dist/browser/models/azure/search/documents/indexes/models.js.map +1 -1
- package/dist/browser/models/azure/search/documents/knowledgeBases/index.d.ts +2 -1
- package/dist/browser/models/azure/search/documents/knowledgeBases/index.d.ts.map +1 -1
- package/dist/browser/models/azure/search/documents/knowledgeBases/index.js +1 -1
- package/dist/browser/models/azure/search/documents/knowledgeBases/index.js.map +1 -1
- package/dist/browser/models/azure/search/documents/knowledgeBases/models.d.ts +135 -242
- package/dist/browser/models/azure/search/documents/knowledgeBases/models.d.ts.map +1 -1
- package/dist/browser/models/azure/search/documents/knowledgeBases/models.js +131 -291
- package/dist/browser/models/azure/search/documents/knowledgeBases/models.js.map +1 -1
- package/dist/browser/models/azure/search/documents/models.d.ts +2 -466
- package/dist/browser/models/azure/search/documents/models.d.ts.map +1 -1
- package/dist/browser/models/azure/search/documents/models.js +1 -429
- package/dist/browser/models/azure/search/documents/models.js.map +1 -1
- package/dist/browser/models/index.d.ts +1 -0
- package/dist/browser/models/index.d.ts.map +1 -1
- package/dist/browser/models/index.js.map +1 -1
- package/dist/browser/models/models.d.ts +3 -3
- package/dist/browser/models/models.d.ts.map +1 -1
- package/dist/browser/models/models.js +3 -3
- package/dist/browser/models/models.js.map +1 -1
- package/dist/browser/search/api/index.d.ts +2 -1
- package/dist/browser/search/api/index.d.ts.map +1 -1
- package/dist/browser/search/api/index.js +1 -1
- package/dist/browser/search/api/index.js.map +1 -1
- package/dist/browser/search/api/operations.d.ts.map +1 -1
- package/dist/browser/search/api/operations.js +35 -54
- package/dist/browser/search/api/operations.js.map +1 -1
- package/dist/browser/search/api/options.d.ts +19 -31
- package/dist/browser/search/api/options.d.ts.map +1 -1
- package/dist/browser/search/api/options.js.map +1 -1
- package/dist/browser/search/api/searchContext.js +1 -1
- package/dist/browser/search/api/searchContext.js.map +1 -1
- package/dist/browser/searchClient.d.ts +0 -1
- package/dist/browser/searchClient.d.ts.map +1 -1
- package/dist/browser/searchClient.js +22 -39
- package/dist/browser/searchClient.js.map +1 -1
- package/dist/browser/searchIndex/api/index.d.ts +4 -3
- package/dist/browser/searchIndex/api/index.d.ts.map +1 -1
- package/dist/browser/searchIndex/api/index.js +2 -2
- package/dist/browser/searchIndex/api/index.js.map +1 -1
- package/dist/browser/searchIndex/api/operations.d.ts +2 -6
- package/dist/browser/searchIndex/api/operations.d.ts.map +1 -1
- package/dist/browser/searchIndex/api/operations.js +186 -96
- package/dist/browser/searchIndex/api/operations.js.map +1 -1
- package/dist/browser/searchIndex/api/options.d.ts +60 -5
- package/dist/browser/searchIndex/api/options.d.ts.map +1 -1
- package/dist/browser/searchIndex/api/options.js.map +1 -1
- package/dist/browser/searchIndex/api/searchIndexContext.js +1 -1
- package/dist/browser/searchIndex/api/searchIndexContext.js.map +1 -1
- package/dist/browser/searchIndex/index.d.ts +1 -1
- package/dist/browser/searchIndex/index.d.ts.map +1 -1
- package/dist/browser/searchIndex/index.js.map +1 -1
- package/dist/browser/searchIndex/searchIndexClient.d.ts +2 -4
- package/dist/browser/searchIndex/searchIndexClient.d.ts.map +1 -1
- package/dist/browser/searchIndex/searchIndexClient.js +1 -5
- package/dist/browser/searchIndex/searchIndexClient.js.map +1 -1
- package/dist/browser/searchIndexClient.d.ts +2 -7
- package/dist/browser/searchIndexClient.d.ts.map +1 -1
- package/dist/browser/searchIndexClient.js +2 -9
- package/dist/browser/searchIndexClient.js.map +1 -1
- package/dist/browser/searchIndexer/api/index.d.ts +4 -3
- package/dist/browser/searchIndexer/api/index.d.ts.map +1 -1
- package/dist/browser/searchIndexer/api/index.js +2 -2
- package/dist/browser/searchIndexer/api/index.js.map +1 -1
- package/dist/browser/searchIndexer/api/operations.d.ts +2 -14
- package/dist/browser/searchIndexer/api/operations.d.ts.map +1 -1
- package/dist/browser/searchIndexer/api/operations.js +112 -150
- package/dist/browser/searchIndexer/api/operations.js.map +1 -1
- package/dist/browser/searchIndexer/api/options.d.ts +36 -30
- package/dist/browser/searchIndexer/api/options.d.ts.map +1 -1
- package/dist/browser/searchIndexer/api/options.js.map +1 -1
- package/dist/browser/searchIndexer/api/searchIndexerContext.js +1 -1
- package/dist/browser/searchIndexer/api/searchIndexerContext.js.map +1 -1
- package/dist/browser/searchIndexer/index.d.ts +1 -1
- package/dist/browser/searchIndexer/index.d.ts.map +1 -1
- package/dist/browser/searchIndexer/index.js.map +1 -1
- package/dist/browser/searchIndexer/searchIndexerClient.d.ts +2 -8
- package/dist/browser/searchIndexer/searchIndexerClient.d.ts.map +1 -1
- package/dist/browser/searchIndexer/searchIndexerClient.js +1 -13
- package/dist/browser/searchIndexer/searchIndexerClient.js.map +1 -1
- package/dist/browser/searchIndexerClient.d.ts +1 -14
- package/dist/browser/searchIndexerClient.d.ts.map +1 -1
- package/dist/browser/searchIndexerClient.js +0 -27
- package/dist/browser/searchIndexerClient.js.map +1 -1
- package/dist/browser/searchIndexingBufferedSender.d.ts.map +1 -1
- package/dist/browser/searchIndexingBufferedSender.js +3 -7
- package/dist/browser/searchIndexingBufferedSender.js.map +1 -1
- package/dist/browser/serviceModels.d.ts +7 -191
- package/dist/browser/serviceModels.d.ts.map +1 -1
- package/dist/browser/serviceModels.js.map +1 -1
- package/dist/browser/serviceUtils.d.ts +3 -5
- package/dist/browser/serviceUtils.d.ts.map +1 -1
- package/dist/browser/serviceUtils.js +30 -87
- package/dist/browser/serviceUtils.js.map +1 -1
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/browser/{synonymMapHelper.d.ts → synonymMapHelper-browser.d.mts} +3 -3
- package/dist/browser/synonymMapHelper-browser.d.mts.map +1 -0
- package/dist/browser/{synonymMapHelper.js → synonymMapHelper-browser.mjs} +3 -3
- package/dist/browser/synonymMapHelper-browser.mjs.map +1 -0
- package/dist/browser/timers-browser.d.mts +8 -0
- package/dist/browser/timers-browser.d.mts.map +1 -0
- package/dist/browser/timers-browser.mjs +13 -0
- package/dist/browser/timers-browser.mjs.map +1 -0
- package/dist/browser/tracing.d.ts.map +1 -1
- package/dist/browser/walk.js +1 -1
- package/dist/browser/walk.js.map +1 -1
- package/dist/commonjs/base64.d.ts.map +1 -1
- package/dist/commonjs/base64.js +4 -2
- package/dist/commonjs/base64.js.map +3 -3
- package/dist/commonjs/geographyPoint.js +1 -0
- package/dist/commonjs/geographyPoint.js.map +1 -1
- package/dist/commonjs/index.d.ts +8 -6
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -29
- package/dist/commonjs/index.js.map +3 -3
- package/dist/commonjs/indexDocumentsBatch.js +1 -0
- package/dist/commonjs/indexDocumentsBatch.js.map +1 -1
- package/dist/commonjs/indexModels.d.ts +13 -112
- package/dist/commonjs/indexModels.d.ts.map +1 -1
- package/dist/commonjs/indexModels.js +1 -0
- package/dist/commonjs/indexModels.js.map +2 -2
- package/dist/commonjs/knowledgeBaseModels.d.ts +4 -17
- package/dist/commonjs/knowledgeBaseModels.d.ts.map +1 -1
- package/dist/commonjs/knowledgeBaseModels.js +1 -0
- package/dist/commonjs/knowledgeBaseModels.js.map +2 -2
- package/dist/commonjs/knowledgeBaseRetrieval/api/index.d.ts +2 -1
- package/dist/commonjs/knowledgeBaseRetrieval/api/index.d.ts.map +1 -1
- package/dist/commonjs/knowledgeBaseRetrieval/api/index.js +1 -0
- package/dist/commonjs/knowledgeBaseRetrieval/api/index.js.map +3 -3
- package/dist/commonjs/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts +3 -1
- package/dist/commonjs/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts.map +1 -1
- package/dist/commonjs/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js +4 -3
- package/dist/commonjs/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js.map +3 -3
- package/dist/commonjs/knowledgeBaseRetrieval/api/operations.d.ts +2 -2
- package/dist/commonjs/knowledgeBaseRetrieval/api/operations.d.ts.map +1 -1
- package/dist/commonjs/knowledgeBaseRetrieval/api/operations.js +9 -7
- package/dist/commonjs/knowledgeBaseRetrieval/api/operations.js.map +3 -3
- package/dist/commonjs/knowledgeBaseRetrieval/api/options.d.ts +2 -2
- package/dist/commonjs/knowledgeBaseRetrieval/api/options.d.ts.map +1 -1
- package/dist/commonjs/knowledgeBaseRetrieval/api/options.js +1 -0
- package/dist/commonjs/knowledgeBaseRetrieval/api/options.js.map +2 -2
- package/dist/commonjs/knowledgeBaseRetrieval/index.js +1 -0
- package/dist/commonjs/knowledgeBaseRetrieval/index.js.map +1 -1
- package/dist/commonjs/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts +2 -2
- package/dist/commonjs/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts.map +1 -1
- package/dist/commonjs/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js +5 -4
- package/dist/commonjs/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js.map +3 -3
- package/dist/commonjs/knowledgeRetrievalClient.d.ts +2 -2
- package/dist/commonjs/knowledgeRetrievalClient.d.ts.map +1 -1
- package/dist/commonjs/knowledgeRetrievalClient.js +10 -4
- package/dist/commonjs/knowledgeRetrievalClient.js.map +3 -3
- package/dist/commonjs/logger.js +1 -0
- package/dist/commonjs/logger.js.map +1 -1
- package/dist/commonjs/models/azure/search/documents/index.d.ts +2 -1
- package/dist/commonjs/models/azure/search/documents/index.d.ts.map +1 -1
- package/dist/commonjs/models/azure/search/documents/index.js +3 -16
- package/dist/commonjs/models/azure/search/documents/index.js.map +3 -3
- package/dist/commonjs/models/azure/search/documents/indexes/index.d.ts +2 -1
- package/dist/commonjs/models/azure/search/documents/indexes/index.d.ts.map +1 -1
- package/dist/commonjs/models/azure/search/documents/indexes/index.js +1 -18
- package/dist/commonjs/models/azure/search/documents/indexes/index.js.map +3 -3
- package/dist/commonjs/models/azure/search/documents/indexes/models.d.ts +50 -477
- package/dist/commonjs/models/azure/search/documents/indexes/models.d.ts.map +1 -1
- package/dist/commonjs/models/azure/search/documents/indexes/models.js +40 -501
- package/dist/commonjs/models/azure/search/documents/indexes/models.js.map +4 -4
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/index.d.ts +2 -1
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/index.d.ts.map +1 -1
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/index.js +1 -2
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/index.js.map +3 -3
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/models.d.ts +135 -242
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/models.d.ts.map +1 -1
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/models.js +136 -335
- package/dist/commonjs/models/azure/search/documents/knowledgeBases/models.js.map +4 -4
- package/dist/commonjs/models/azure/search/documents/models.d.ts +2 -466
- package/dist/commonjs/models/azure/search/documents/models.d.ts.map +1 -1
- package/dist/commonjs/models/azure/search/documents/models.js +8 -354
- package/dist/commonjs/models/azure/search/documents/models.js.map +4 -4
- package/dist/commonjs/models/index.d.ts +1 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +1 -0
- package/dist/commonjs/models/index.js.map +2 -2
- package/dist/commonjs/models/models.d.ts +3 -3
- package/dist/commonjs/models/models.d.ts.map +1 -1
- package/dist/commonjs/models/models.js +2 -1
- package/dist/commonjs/models/models.js.map +3 -3
- package/dist/commonjs/odata.js +1 -0
- package/dist/commonjs/odata.js.map +1 -1
- package/dist/commonjs/odataMetadataPolicy.js +1 -0
- package/dist/commonjs/odataMetadataPolicy.js.map +1 -1
- package/dist/commonjs/search/api/index.d.ts +2 -1
- package/dist/commonjs/search/api/index.d.ts.map +1 -1
- package/dist/commonjs/search/api/index.js +1 -0
- package/dist/commonjs/search/api/index.js.map +3 -3
- package/dist/commonjs/search/api/operations.d.ts.map +1 -1
- package/dist/commonjs/search/api/operations.js +22 -42
- package/dist/commonjs/search/api/operations.js.map +3 -3
- package/dist/commonjs/search/api/options.d.ts +19 -31
- package/dist/commonjs/search/api/options.d.ts.map +1 -1
- package/dist/commonjs/search/api/options.js +1 -0
- package/dist/commonjs/search/api/options.js.map +2 -2
- package/dist/commonjs/search/api/searchContext.js +2 -1
- package/dist/commonjs/search/api/searchContext.js.map +2 -2
- package/dist/commonjs/search/index.js +1 -0
- package/dist/commonjs/search/index.js.map +1 -1
- package/dist/commonjs/search/searchClient.js +1 -0
- package/dist/commonjs/search/searchClient.js.map +1 -1
- package/dist/commonjs/searchApiKeyCredentialPolicy.js +1 -0
- package/dist/commonjs/searchApiKeyCredentialPolicy.js.map +1 -1
- package/dist/commonjs/searchAudience.js +1 -0
- package/dist/commonjs/searchAudience.js.map +1 -1
- package/dist/commonjs/searchClient.d.ts +0 -1
- package/dist/commonjs/searchClient.d.ts.map +1 -1
- package/dist/commonjs/searchClient.js +24 -43
- package/dist/commonjs/searchClient.js.map +3 -3
- package/dist/commonjs/searchIndex/api/index.d.ts +4 -3
- package/dist/commonjs/searchIndex/api/index.d.ts.map +1 -1
- package/dist/commonjs/searchIndex/api/index.js +1 -2
- package/dist/commonjs/searchIndex/api/index.js.map +3 -3
- package/dist/commonjs/searchIndex/api/operations.d.ts +2 -6
- package/dist/commonjs/searchIndex/api/operations.d.ts.map +1 -1
- package/dist/commonjs/searchIndex/api/operations.js +126 -108
- package/dist/commonjs/searchIndex/api/operations.js.map +3 -3
- package/dist/commonjs/searchIndex/api/options.d.ts +60 -5
- package/dist/commonjs/searchIndex/api/options.d.ts.map +1 -1
- package/dist/commonjs/searchIndex/api/options.js +1 -0
- package/dist/commonjs/searchIndex/api/options.js.map +2 -2
- package/dist/commonjs/searchIndex/api/searchIndexContext.js +2 -1
- package/dist/commonjs/searchIndex/api/searchIndexContext.js.map +2 -2
- package/dist/commonjs/searchIndex/index.d.ts +1 -1
- package/dist/commonjs/searchIndex/index.d.ts.map +1 -1
- package/dist/commonjs/searchIndex/index.js +1 -0
- package/dist/commonjs/searchIndex/index.js.map +2 -2
- package/dist/commonjs/searchIndex/searchIndexClient.d.ts +2 -4
- package/dist/commonjs/searchIndex/searchIndexClient.d.ts.map +1 -1
- package/dist/commonjs/searchIndex/searchIndexClient.js +1 -4
- package/dist/commonjs/searchIndex/searchIndexClient.js.map +3 -3
- package/dist/commonjs/searchIndexClient.d.ts +2 -7
- package/dist/commonjs/searchIndexClient.d.ts.map +1 -1
- package/dist/commonjs/searchIndexClient.js +3 -9
- package/dist/commonjs/searchIndexClient.js.map +3 -3
- package/dist/commonjs/searchIndexer/api/index.d.ts +4 -3
- package/dist/commonjs/searchIndexer/api/index.d.ts.map +1 -1
- package/dist/commonjs/searchIndexer/api/index.js +1 -6
- package/dist/commonjs/searchIndexer/api/index.js.map +3 -3
- package/dist/commonjs/searchIndexer/api/operations.d.ts +2 -14
- package/dist/commonjs/searchIndexer/api/operations.d.ts.map +1 -1
- package/dist/commonjs/searchIndexer/api/operations.js +76 -168
- package/dist/commonjs/searchIndexer/api/operations.js.map +3 -3
- package/dist/commonjs/searchIndexer/api/options.d.ts +36 -30
- package/dist/commonjs/searchIndexer/api/options.d.ts.map +1 -1
- package/dist/commonjs/searchIndexer/api/options.js +1 -0
- package/dist/commonjs/searchIndexer/api/options.js.map +2 -2
- package/dist/commonjs/searchIndexer/api/searchIndexerContext.js +2 -1
- package/dist/commonjs/searchIndexer/api/searchIndexerContext.js.map +2 -2
- package/dist/commonjs/searchIndexer/index.d.ts +1 -1
- package/dist/commonjs/searchIndexer/index.d.ts.map +1 -1
- package/dist/commonjs/searchIndexer/index.js +1 -0
- package/dist/commonjs/searchIndexer/index.js.map +2 -2
- package/dist/commonjs/searchIndexer/searchIndexerClient.d.ts +2 -8
- package/dist/commonjs/searchIndexer/searchIndexerClient.d.ts.map +1 -1
- package/dist/commonjs/searchIndexer/searchIndexerClient.js +1 -12
- package/dist/commonjs/searchIndexer/searchIndexerClient.js.map +3 -3
- package/dist/commonjs/searchIndexerClient.d.ts +1 -14
- package/dist/commonjs/searchIndexerClient.d.ts.map +1 -1
- package/dist/commonjs/searchIndexerClient.js +1 -39
- package/dist/commonjs/searchIndexerClient.js.map +3 -3
- package/dist/commonjs/searchIndexingBufferedSender.d.ts.map +1 -1
- package/dist/commonjs/searchIndexingBufferedSender.js +4 -7
- package/dist/commonjs/searchIndexingBufferedSender.js.map +3 -3
- package/dist/commonjs/serialization.js +1 -0
- package/dist/commonjs/serialization.js.map +1 -1
- package/dist/commonjs/serviceModels.d.ts +7 -191
- package/dist/commonjs/serviceModels.d.ts.map +1 -1
- package/dist/commonjs/serviceModels.js +1 -0
- package/dist/commonjs/serviceModels.js.map +3 -3
- package/dist/commonjs/serviceUtils.d.ts +3 -5
- package/dist/commonjs/serviceUtils.d.ts.map +1 -1
- package/dist/commonjs/serviceUtils.js +31 -89
- package/dist/commonjs/serviceUtils.js.map +3 -3
- package/dist/commonjs/static-helpers/pagingHelpers.js +1 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +2 -2
- package/dist/commonjs/static-helpers/serialization/build-csv-collection.js +1 -0
- package/dist/commonjs/static-helpers/serialization/build-csv-collection.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/build-newline-collection.js +1 -0
- package/dist/commonjs/static-helpers/serialization/build-newline-collection.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/build-pipe-collection.js +1 -0
- package/dist/commonjs/static-helpers/serialization/build-pipe-collection.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/check-prop-undefined.js +1 -0
- package/dist/commonjs/static-helpers/serialization/check-prop-undefined.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/parse-csv-collection.js +1 -0
- package/dist/commonjs/static-helpers/serialization/parse-csv-collection.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/parse-newline-collection.js +1 -0
- package/dist/commonjs/static-helpers/serialization/parse-newline-collection.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/parse-pipe-collection.js +1 -0
- package/dist/commonjs/static-helpers/serialization/parse-pipe-collection.js.map +1 -1
- package/dist/commonjs/static-helpers/serialization/serialize-record.js +1 -0
- package/dist/commonjs/static-helpers/serialization/serialize-record.js.map +1 -1
- package/dist/commonjs/static-helpers/urlTemplate.js +1 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
- package/dist/commonjs/synonymMapHelper.js +1 -0
- package/dist/commonjs/synonymMapHelper.js.map +1 -1
- package/dist/commonjs/timers.d.ts +9 -0
- package/dist/commonjs/timers.d.ts.map +1 -0
- package/dist/commonjs/{errorModels.js → timers.js} +19 -2
- package/dist/commonjs/timers.js.map +7 -0
- package/dist/commonjs/tracing.d.ts.map +1 -1
- package/dist/commonjs/tracing.js +1 -0
- package/dist/commonjs/tracing.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/walk.js +2 -1
- package/dist/commonjs/walk.js.map +3 -3
- package/dist/esm/base64.d.ts.map +1 -1
- package/dist/esm/base64.js +16 -8
- package/dist/esm/base64.js.map +1 -7
- package/dist/esm/geographyPoint.js +35 -32
- package/dist/esm/geographyPoint.js.map +1 -7
- package/dist/esm/index.d.ts +8 -6
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +17 -190
- package/dist/esm/index.js.map +1 -7
- package/dist/esm/indexDocumentsBatch.js +78 -73
- package/dist/esm/indexDocumentsBatch.js.map +1 -7
- package/dist/esm/indexModels.d.ts +13 -112
- package/dist/esm/indexModels.d.ts.map +1 -1
- package/dist/esm/indexModels.js +4 -0
- package/dist/esm/indexModels.js.map +1 -7
- package/dist/esm/knowledgeBaseModels.d.ts +4 -17
- package/dist/esm/knowledgeBaseModels.d.ts.map +1 -1
- package/dist/esm/knowledgeBaseModels.js +4 -0
- package/dist/esm/knowledgeBaseModels.js.map +1 -7
- package/dist/esm/knowledgeBaseRetrieval/api/index.d.ts +2 -1
- package/dist/esm/knowledgeBaseRetrieval/api/index.d.ts.map +1 -1
- package/dist/esm/knowledgeBaseRetrieval/api/index.js +5 -8
- package/dist/esm/knowledgeBaseRetrieval/api/index.js.map +1 -7
- package/dist/esm/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts +3 -1
- package/dist/esm/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts.map +1 -1
- package/dist/esm/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js +22 -20
- package/dist/esm/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js.map +1 -7
- package/dist/esm/knowledgeBaseRetrieval/api/operations.d.ts +2 -2
- package/dist/esm/knowledgeBaseRetrieval/api/operations.d.ts.map +1 -1
- package/dist/esm/knowledgeBaseRetrieval/api/operations.js +39 -42
- package/dist/esm/knowledgeBaseRetrieval/api/operations.js.map +1 -7
- package/dist/esm/knowledgeBaseRetrieval/api/options.d.ts +2 -2
- package/dist/esm/knowledgeBaseRetrieval/api/options.d.ts.map +1 -1
- package/dist/esm/knowledgeBaseRetrieval/api/options.js +4 -0
- package/dist/esm/knowledgeBaseRetrieval/api/options.js.map +1 -7
- package/dist/esm/knowledgeBaseRetrieval/index.js +4 -4
- package/dist/esm/knowledgeBaseRetrieval/index.js.map +1 -7
- package/dist/esm/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts +2 -2
- package/dist/esm/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts.map +1 -1
- package/dist/esm/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js +22 -20
- package/dist/esm/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js.map +1 -7
- package/dist/esm/knowledgeRetrievalClient.d.ts +2 -2
- package/dist/esm/knowledgeRetrievalClient.d.ts.map +1 -1
- package/dist/esm/knowledgeRetrievalClient.js +89 -91
- package/dist/esm/knowledgeRetrievalClient.js.map +1 -7
- package/dist/esm/logger.js +7 -4
- package/dist/esm/logger.js.map +1 -7
- package/dist/esm/models/azure/search/documents/index.d.ts +2 -1
- package/dist/esm/models/azure/search/documents/index.d.ts.map +1 -1
- package/dist/esm/models/azure/search/documents/index.js +4 -36
- package/dist/esm/models/azure/search/documents/index.js.map +1 -7
- package/dist/esm/models/azure/search/documents/indexes/index.d.ts +2 -1
- package/dist/esm/models/azure/search/documents/indexes/index.d.ts.map +1 -1
- package/dist/esm/models/azure/search/documents/indexes/index.js +4 -130
- package/dist/esm/models/azure/search/documents/indexes/index.js.map +1 -7
- package/dist/esm/models/azure/search/documents/indexes/models.d.ts +50 -477
- package/dist/esm/models/azure/search/documents/indexes/models.d.ts.map +1 -1
- package/dist/esm/models/azure/search/documents/indexes/models.js +6374 -6188
- package/dist/esm/models/azure/search/documents/indexes/models.js.map +1 -7
- package/dist/esm/models/azure/search/documents/knowledgeBases/index.d.ts +2 -1
- package/dist/esm/models/azure/search/documents/knowledgeBases/index.d.ts.map +1 -1
- package/dist/esm/models/azure/search/documents/knowledgeBases/index.js +4 -16
- package/dist/esm/models/azure/search/documents/knowledgeBases/index.js.map +1 -7
- package/dist/esm/models/azure/search/documents/knowledgeBases/models.d.ts +135 -242
- package/dist/esm/models/azure/search/documents/knowledgeBases/models.d.ts.map +1 -1
- package/dist/esm/models/azure/search/documents/knowledgeBases/models.js +592 -790
- package/dist/esm/models/azure/search/documents/knowledgeBases/models.js.map +1 -7
- package/dist/esm/models/azure/search/documents/models.d.ts +2 -466
- package/dist/esm/models/azure/search/documents/models.d.ts.map +1 -1
- package/dist/esm/models/azure/search/documents/models.js +591 -919
- package/dist/esm/models/azure/search/documents/models.js.map +1 -7
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +4 -4
- package/dist/esm/models/index.js.map +1 -7
- package/dist/esm/models/models.d.ts +3 -3
- package/dist/esm/models/models.d.ts.map +1 -1
- package/dist/esm/models/models.js +14 -13
- package/dist/esm/models/models.js.map +1 -7
- package/dist/esm/odata.js +43 -26
- package/dist/esm/odata.js.map +1 -7
- package/dist/esm/odataMetadataPolicy.js +15 -11
- package/dist/esm/odataMetadataPolicy.js.map +1 -7
- package/dist/esm/search/api/index.d.ts +2 -1
- package/dist/esm/search/api/index.d.ts.map +1 -1
- package/dist/esm/search/api/index.js +5 -26
- package/dist/esm/search/api/index.js.map +1 -7
- package/dist/esm/search/api/operations.d.ts.map +1 -1
- package/dist/esm/search/api/operations.js +418 -452
- package/dist/esm/search/api/operations.js.map +1 -7
- package/dist/esm/search/api/options.d.ts +19 -31
- package/dist/esm/search/api/options.d.ts.map +1 -1
- package/dist/esm/search/api/options.js +4 -0
- package/dist/esm/search/api/options.js.map +1 -7
- package/dist/esm/search/api/searchContext.js +22 -20
- package/dist/esm/search/api/searchContext.js.map +1 -7
- package/dist/esm/search/index.js +4 -4
- package/dist/esm/search/index.js.map +1 -7
- package/dist/esm/search/searchClient.js +55 -63
- package/dist/esm/search/searchClient.js.map +1 -7
- package/dist/esm/searchApiKeyCredentialPolicy.js +17 -13
- package/dist/esm/searchApiKeyCredentialPolicy.js.map +1 -7
- package/dist/esm/searchAudience.js +21 -9
- package/dist/esm/searchAudience.js.map +1 -7
- package/dist/esm/searchClient.d.ts +0 -1
- package/dist/esm/searchClient.d.ts.map +1 -1
- package/dist/esm/searchClient.js +539 -624
- package/dist/esm/searchClient.js.map +1 -7
- package/dist/esm/searchIndex/api/index.d.ts +4 -3
- package/dist/esm/searchIndex/api/index.d.ts.map +1 -1
- package/dist/esm/searchIndex/api/index.js +5 -70
- package/dist/esm/searchIndex/api/index.js.map +1 -7
- package/dist/esm/searchIndex/api/operations.d.ts +2 -6
- package/dist/esm/searchIndex/api/operations.d.ts.map +1 -1
- package/dist/esm/searchIndex/api/operations.js +1087 -1177
- package/dist/esm/searchIndex/api/operations.js.map +1 -7
- package/dist/esm/searchIndex/api/options.d.ts +60 -5
- package/dist/esm/searchIndex/api/options.d.ts.map +1 -1
- package/dist/esm/searchIndex/api/options.js +4 -0
- package/dist/esm/searchIndex/api/options.js.map +1 -7
- package/dist/esm/searchIndex/api/searchIndexContext.js +22 -20
- package/dist/esm/searchIndex/api/searchIndexContext.js.map +1 -7
- package/dist/esm/searchIndex/index.d.ts +1 -1
- package/dist/esm/searchIndex/index.d.ts.map +1 -1
- package/dist/esm/searchIndex/index.js +4 -4
- package/dist/esm/searchIndex/index.js.map +1 -7
- package/dist/esm/searchIndex/searchIndexClient.d.ts +2 -4
- package/dist/esm/searchIndex/searchIndexClient.d.ts.map +1 -1
- package/dist/esm/searchIndex/searchIndexClient.js +139 -173
- package/dist/esm/searchIndex/searchIndexClient.js.map +1 -7
- package/dist/esm/searchIndexClient.d.ts +2 -7
- package/dist/esm/searchIndexClient.d.ts.map +1 -1
- package/dist/esm/searchIndexClient.js +448 -588
- package/dist/esm/searchIndexClient.js.map +1 -7
- package/dist/esm/searchIndexer/api/index.d.ts +4 -3
- package/dist/esm/searchIndexer/api/index.d.ts.map +1 -1
- package/dist/esm/searchIndexer/api/index.js +5 -50
- package/dist/esm/searchIndexer/api/index.js.map +1 -7
- package/dist/esm/searchIndexer/api/operations.d.ts +2 -14
- package/dist/esm/searchIndexer/api/operations.d.ts.map +1 -1
- package/dist/esm/searchIndexer/api/operations.js +676 -809
- package/dist/esm/searchIndexer/api/operations.js.map +1 -7
- package/dist/esm/searchIndexer/api/options.d.ts +36 -30
- package/dist/esm/searchIndexer/api/options.d.ts.map +1 -1
- package/dist/esm/searchIndexer/api/options.js +4 -0
- package/dist/esm/searchIndexer/api/options.js.map +1 -7
- package/dist/esm/searchIndexer/api/searchIndexerContext.js +22 -20
- package/dist/esm/searchIndexer/api/searchIndexerContext.js.map +1 -7
- package/dist/esm/searchIndexer/index.d.ts +1 -1
- package/dist/esm/searchIndexer/index.d.ts.map +1 -1
- package/dist/esm/searchIndexer/index.js +4 -4
- package/dist/esm/searchIndexer/index.js.map +1 -7
- package/dist/esm/searchIndexer/searchIndexerClient.d.ts +2 -8
- package/dist/esm/searchIndexer/searchIndexerClient.d.ts.map +1 -1
- package/dist/esm/searchIndexer/searchIndexerClient.js +91 -123
- package/dist/esm/searchIndexer/searchIndexerClient.js.map +1 -7
- package/dist/esm/searchIndexerClient.d.ts +1 -14
- package/dist/esm/searchIndexerClient.d.ts.map +1 -1
- package/dist/esm/searchIndexerClient.js +347 -473
- package/dist/esm/searchIndexerClient.js.map +1 -7
- package/dist/esm/searchIndexingBufferedSender.d.ts.map +1 -1
- package/dist/esm/searchIndexingBufferedSender.js +302 -285
- package/dist/esm/searchIndexingBufferedSender.js.map +1 -7
- package/dist/esm/serialization.js +112 -111
- package/dist/esm/serialization.js.map +1 -7
- package/dist/esm/serviceModels.d.ts +7 -191
- package/dist/esm/serviceModels.d.ts.map +1 -1
- package/dist/esm/serviceModels.js +654 -162
- package/dist/esm/serviceModels.js.map +1 -7
- package/dist/esm/serviceUtils.d.ts +3 -5
- package/dist/esm/serviceUtils.d.ts.map +1 -1
- package/dist/esm/serviceUtils.js +776 -865
- package/dist/esm/serviceUtils.js.map +1 -7
- package/dist/esm/static-helpers/pagingHelpers.js +122 -98
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -7
- package/dist/esm/static-helpers/serialization/build-csv-collection.js +5 -5
- package/dist/esm/static-helpers/serialization/build-csv-collection.js.map +1 -7
- package/dist/esm/static-helpers/serialization/build-newline-collection.js +5 -5
- package/dist/esm/static-helpers/serialization/build-newline-collection.js.map +1 -7
- package/dist/esm/static-helpers/serialization/build-pipe-collection.js +5 -5
- package/dist/esm/static-helpers/serialization/build-pipe-collection.js.map +1 -7
- package/dist/esm/static-helpers/serialization/check-prop-undefined.js +15 -9
- package/dist/esm/static-helpers/serialization/check-prop-undefined.js.map +1 -7
- package/dist/esm/static-helpers/serialization/parse-csv-collection.js +5 -5
- package/dist/esm/static-helpers/serialization/parse-csv-collection.js.map +1 -7
- package/dist/esm/static-helpers/serialization/parse-newline-collection.js +5 -5
- package/dist/esm/static-helpers/serialization/parse-newline-collection.js.map +1 -7
- package/dist/esm/static-helpers/serialization/parse-pipe-collection.js +5 -5
- package/dist/esm/static-helpers/serialization/parse-pipe-collection.js.map +1 -7
- package/dist/esm/static-helpers/serialization/serialize-record.js +17 -16
- package/dist/esm/static-helpers/serialization/serialize-record.js.map +1 -7
- package/dist/esm/static-helpers/urlTemplate.js +169 -142
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -7
- package/dist/esm/synonymMapHelper.js +20 -9
- package/dist/esm/synonymMapHelper.js.map +1 -7
- package/dist/esm/timers.d.ts +9 -0
- package/dist/esm/timers.d.ts.map +1 -0
- package/dist/esm/timers.js +15 -0
- package/dist/esm/timers.js.map +1 -0
- package/dist/esm/tracing.d.ts.map +1 -1
- package/dist/esm/tracing.js +11 -8
- package/dist/esm/tracing.js.map +1 -7
- package/dist/esm/walk.js +64 -52
- package/dist/esm/walk.js.map +1 -7
- package/dist/react-native/base64.d.ts.map +1 -1
- package/dist/react-native/base64.js +3 -2
- package/dist/react-native/base64.js.map +1 -1
- package/dist/react-native/index.d.ts +9 -7
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js +3 -4
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/indexModels.d.ts +13 -112
- package/dist/react-native/indexModels.d.ts.map +1 -1
- package/dist/react-native/indexModels.js.map +1 -1
- package/dist/react-native/knowledgeBaseModels.d.ts +4 -17
- package/dist/react-native/knowledgeBaseModels.d.ts.map +1 -1
- package/dist/react-native/knowledgeBaseModels.js.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/index.d.ts +2 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/index.d.ts.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/index.js +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/index.js.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts +3 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.d.ts.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js +3 -3
- package/dist/react-native/knowledgeBaseRetrieval/api/knowledgeBaseRetrievalContext.js.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/operations.d.ts +2 -2
- package/dist/react-native/knowledgeBaseRetrieval/api/operations.d.ts.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/operations.js +9 -8
- package/dist/react-native/knowledgeBaseRetrieval/api/operations.js.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/options.d.ts +2 -2
- package/dist/react-native/knowledgeBaseRetrieval/api/options.d.ts.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/api/options.js.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts +2 -2
- package/dist/react-native/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.d.ts.map +1 -1
- package/dist/react-native/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js +4 -4
- package/dist/react-native/knowledgeBaseRetrieval/knowledgeBaseRetrievalClient.js.map +1 -1
- package/dist/react-native/knowledgeRetrievalClient.d.ts +2 -2
- package/dist/react-native/knowledgeRetrievalClient.d.ts.map +1 -1
- package/dist/react-native/knowledgeRetrievalClient.js +4 -4
- package/dist/react-native/knowledgeRetrievalClient.js.map +1 -1
- package/dist/react-native/models/azure/search/documents/index.d.ts +2 -1
- package/dist/react-native/models/azure/search/documents/index.d.ts.map +1 -1
- package/dist/react-native/models/azure/search/documents/index.js +1 -1
- package/dist/react-native/models/azure/search/documents/index.js.map +1 -1
- package/dist/react-native/models/azure/search/documents/indexes/index.d.ts +2 -1
- package/dist/react-native/models/azure/search/documents/indexes/index.d.ts.map +1 -1
- package/dist/react-native/models/azure/search/documents/indexes/index.js +1 -1
- package/dist/react-native/models/azure/search/documents/indexes/index.js.map +1 -1
- package/dist/react-native/models/azure/search/documents/indexes/models.d.ts +50 -477
- package/dist/react-native/models/azure/search/documents/indexes/models.d.ts.map +1 -1
- package/dist/react-native/models/azure/search/documents/indexes/models.js +40 -526
- package/dist/react-native/models/azure/search/documents/indexes/models.js.map +1 -1
- package/dist/react-native/models/azure/search/documents/knowledgeBases/index.d.ts +2 -1
- package/dist/react-native/models/azure/search/documents/knowledgeBases/index.d.ts.map +1 -1
- package/dist/react-native/models/azure/search/documents/knowledgeBases/index.js +1 -1
- package/dist/react-native/models/azure/search/documents/knowledgeBases/index.js.map +1 -1
- package/dist/react-native/models/azure/search/documents/knowledgeBases/models.d.ts +135 -242
- package/dist/react-native/models/azure/search/documents/knowledgeBases/models.d.ts.map +1 -1
- package/dist/react-native/models/azure/search/documents/knowledgeBases/models.js +131 -291
- package/dist/react-native/models/azure/search/documents/knowledgeBases/models.js.map +1 -1
- package/dist/react-native/models/azure/search/documents/models.d.ts +2 -466
- package/dist/react-native/models/azure/search/documents/models.d.ts.map +1 -1
- package/dist/react-native/models/azure/search/documents/models.js +1 -429
- package/dist/react-native/models/azure/search/documents/models.js.map +1 -1
- package/dist/react-native/models/index.d.ts +1 -0
- package/dist/react-native/models/index.d.ts.map +1 -1
- package/dist/react-native/models/index.js.map +1 -1
- package/dist/react-native/models/models.d.ts +3 -3
- package/dist/react-native/models/models.d.ts.map +1 -1
- package/dist/react-native/models/models.js +3 -3
- package/dist/react-native/models/models.js.map +1 -1
- package/dist/react-native/search/api/index.d.ts +2 -1
- package/dist/react-native/search/api/index.d.ts.map +1 -1
- package/dist/react-native/search/api/index.js +1 -1
- package/dist/react-native/search/api/index.js.map +1 -1
- package/dist/react-native/search/api/operations.d.ts.map +1 -1
- package/dist/react-native/search/api/operations.js +35 -54
- package/dist/react-native/search/api/operations.js.map +1 -1
- package/dist/react-native/search/api/options.d.ts +19 -31
- package/dist/react-native/search/api/options.d.ts.map +1 -1
- package/dist/react-native/search/api/options.js.map +1 -1
- package/dist/react-native/search/api/searchContext.js +1 -1
- package/dist/react-native/search/api/searchContext.js.map +1 -1
- package/dist/react-native/searchClient.d.ts +0 -1
- package/dist/react-native/searchClient.d.ts.map +1 -1
- package/dist/react-native/searchClient.js +22 -39
- package/dist/react-native/searchClient.js.map +1 -1
- package/dist/react-native/searchIndex/api/index.d.ts +4 -3
- package/dist/react-native/searchIndex/api/index.d.ts.map +1 -1
- package/dist/react-native/searchIndex/api/index.js +2 -2
- package/dist/react-native/searchIndex/api/index.js.map +1 -1
- package/dist/react-native/searchIndex/api/operations.d.ts +2 -6
- package/dist/react-native/searchIndex/api/operations.d.ts.map +1 -1
- package/dist/react-native/searchIndex/api/operations.js +186 -96
- package/dist/react-native/searchIndex/api/operations.js.map +1 -1
- package/dist/react-native/searchIndex/api/options.d.ts +60 -5
- package/dist/react-native/searchIndex/api/options.d.ts.map +1 -1
- package/dist/react-native/searchIndex/api/options.js.map +1 -1
- package/dist/react-native/searchIndex/api/searchIndexContext.js +1 -1
- package/dist/react-native/searchIndex/api/searchIndexContext.js.map +1 -1
- package/dist/react-native/searchIndex/index.d.ts +1 -1
- package/dist/react-native/searchIndex/index.d.ts.map +1 -1
- package/dist/react-native/searchIndex/index.js.map +1 -1
- package/dist/react-native/searchIndex/searchIndexClient.d.ts +2 -4
- package/dist/react-native/searchIndex/searchIndexClient.d.ts.map +1 -1
- package/dist/react-native/searchIndex/searchIndexClient.js +1 -5
- package/dist/react-native/searchIndex/searchIndexClient.js.map +1 -1
- package/dist/react-native/searchIndexClient.d.ts +2 -7
- package/dist/react-native/searchIndexClient.d.ts.map +1 -1
- package/dist/react-native/searchIndexClient.js +2 -9
- package/dist/react-native/searchIndexClient.js.map +1 -1
- package/dist/react-native/searchIndexer/api/index.d.ts +4 -3
- package/dist/react-native/searchIndexer/api/index.d.ts.map +1 -1
- package/dist/react-native/searchIndexer/api/index.js +2 -2
- package/dist/react-native/searchIndexer/api/index.js.map +1 -1
- package/dist/react-native/searchIndexer/api/operations.d.ts +2 -14
- package/dist/react-native/searchIndexer/api/operations.d.ts.map +1 -1
- package/dist/react-native/searchIndexer/api/operations.js +112 -150
- package/dist/react-native/searchIndexer/api/operations.js.map +1 -1
- package/dist/react-native/searchIndexer/api/options.d.ts +36 -30
- package/dist/react-native/searchIndexer/api/options.d.ts.map +1 -1
- package/dist/react-native/searchIndexer/api/options.js.map +1 -1
- package/dist/react-native/searchIndexer/api/searchIndexerContext.js +1 -1
- package/dist/react-native/searchIndexer/api/searchIndexerContext.js.map +1 -1
- package/dist/react-native/searchIndexer/index.d.ts +1 -1
- package/dist/react-native/searchIndexer/index.d.ts.map +1 -1
- package/dist/react-native/searchIndexer/index.js.map +1 -1
- package/dist/react-native/searchIndexer/searchIndexerClient.d.ts +2 -8
- package/dist/react-native/searchIndexer/searchIndexerClient.d.ts.map +1 -1
- package/dist/react-native/searchIndexer/searchIndexerClient.js +1 -13
- package/dist/react-native/searchIndexer/searchIndexerClient.js.map +1 -1
- package/dist/react-native/searchIndexerClient.d.ts +1 -14
- package/dist/react-native/searchIndexerClient.d.ts.map +1 -1
- package/dist/react-native/searchIndexerClient.js +0 -27
- package/dist/react-native/searchIndexerClient.js.map +1 -1
- package/dist/react-native/searchIndexingBufferedSender.d.ts.map +1 -1
- package/dist/react-native/searchIndexingBufferedSender.js +3 -7
- package/dist/react-native/searchIndexingBufferedSender.js.map +1 -1
- package/dist/react-native/serviceModels.d.ts +7 -191
- package/dist/react-native/serviceModels.d.ts.map +1 -1
- package/dist/react-native/serviceModels.js.map +1 -1
- package/dist/react-native/serviceUtils.d.ts +3 -5
- package/dist/react-native/serviceUtils.d.ts.map +1 -1
- package/dist/react-native/serviceUtils.js +30 -87
- package/dist/react-native/serviceUtils.js.map +1 -1
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
- package/dist/react-native/{synonymMapHelper.d.ts → synonymMapHelper-browser.d.mts} +4 -3
- package/dist/react-native/synonymMapHelper-browser.d.mts.map +1 -0
- package/dist/react-native/synonymMapHelper-browser.mjs +14 -0
- package/dist/react-native/synonymMapHelper-browser.mjs.map +1 -0
- package/dist/react-native/synonymMapHelper-react-native.d.mts +2 -0
- package/dist/react-native/synonymMapHelper-react-native.d.mts.map +1 -0
- package/dist/react-native/synonymMapHelper-react-native.mjs +4 -0
- package/dist/react-native/synonymMapHelper-react-native.mjs.map +1 -0
- package/dist/react-native/timers-browser.d.mts +8 -0
- package/dist/react-native/timers-browser.d.mts.map +1 -0
- package/dist/react-native/timers-browser.mjs +13 -0
- package/dist/react-native/timers-browser.mjs.map +1 -0
- package/dist/react-native/timers-react-native.d.mts +2 -0
- package/dist/react-native/timers-react-native.d.mts.map +1 -0
- package/dist/react-native/timers-react-native.mjs +4 -0
- package/dist/react-native/timers-react-native.mjs.map +1 -0
- package/dist/react-native/tracing.d.ts.map +1 -1
- package/dist/react-native/walk.js +1 -1
- package/dist/react-native/walk.js.map +1 -1
- package/package.json +33 -20
- package/dist/browser/errorModels.d.ts +0 -56
- package/dist/browser/errorModels.d.ts.map +0 -1
- package/dist/browser/errorModels.js +0 -4
- package/dist/browser/errorModels.js.map +0 -1
- package/dist/browser/synonymMapHelper.d.ts.map +0 -1
- package/dist/browser/synonymMapHelper.js.map +0 -1
- package/dist/commonjs/errorModels.d.ts +0 -56
- package/dist/commonjs/errorModels.d.ts.map +0 -1
- package/dist/commonjs/errorModels.js.map +0 -7
- package/dist/esm/errorModels.d.ts +0 -56
- package/dist/esm/errorModels.d.ts.map +0 -1
- package/dist/esm/errorModels.js +0 -0
- package/dist/esm/errorModels.js.map +0 -7
- package/dist/react-native/errorModels.d.ts +0 -56
- package/dist/react-native/errorModels.d.ts.map +0 -1
- package/dist/react-native/errorModels.js +0 -4
- package/dist/react-native/errorModels.js.map +0 -1
- package/dist/react-native/synonymMapHelper.d.ts.map +0 -1
- package/dist/react-native/synonymMapHelper.js +0 -24
- package/dist/react-native/synonymMapHelper.js.map +0 -1
package/dist/esm/searchClient.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
1
3
|
import { isTokenCredential } from "@azure/core-auth";
|
|
2
|
-
import {
|
|
3
|
-
bearerTokenAuthenticationPolicy,
|
|
4
|
-
bearerTokenAuthenticationPolicyName
|
|
5
|
-
} from "@azure/core-rest-pipeline";
|
|
4
|
+
import { bearerTokenAuthenticationPolicy, bearerTokenAuthenticationPolicyName, } from "@azure/core-rest-pipeline";
|
|
6
5
|
import { decode, encode } from "./base64.js";
|
|
7
6
|
import { SearchClient as GeneratedClient } from "./search/searchClient.js";
|
|
8
7
|
import { IndexDocumentsBatch } from "./indexDocumentsBatch.js";
|
|
@@ -13,652 +12,568 @@ import { KnownSearchAudience } from "./searchAudience.js";
|
|
|
13
12
|
import { deserialize, serialize } from "./serialization.js";
|
|
14
13
|
import * as utils from "./serviceUtils.js";
|
|
15
14
|
import { tracingClient } from "./tracing.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Class used to perform operations against a search index,
|
|
17
|
+
* including querying documents in the index as well as
|
|
18
|
+
* adding, updating, and removing them.
|
|
19
|
+
*/
|
|
20
|
+
export class SearchClient {
|
|
21
|
+
/// Maintenance note: when updating supported API versions,
|
|
22
|
+
/// the ContinuationToken logic will need to be updated below.
|
|
23
|
+
/**
|
|
24
|
+
* The service version to use when communicating with the service.
|
|
25
|
+
*/
|
|
26
|
+
serviceVersion = utils.defaultServiceVersion;
|
|
27
|
+
/**
|
|
28
|
+
* The API version to use when communicating with the service.
|
|
29
|
+
* @deprecated use {@Link serviceVersion} instead
|
|
30
|
+
*/
|
|
31
|
+
apiVersion = utils.defaultServiceVersion;
|
|
32
|
+
/**
|
|
33
|
+
* The endpoint of the search service
|
|
34
|
+
*/
|
|
35
|
+
endpoint;
|
|
36
|
+
/**
|
|
37
|
+
* The name of the index
|
|
38
|
+
*/
|
|
39
|
+
indexName;
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
* A reference to the auto-generated SearchClient
|
|
43
|
+
*/
|
|
44
|
+
client;
|
|
45
|
+
/**
|
|
46
|
+
* A reference to the internal HTTP pipeline for use with raw requests
|
|
47
|
+
*/
|
|
48
|
+
pipeline;
|
|
49
|
+
/**
|
|
50
|
+
* Creates an instance of SearchClient.
|
|
51
|
+
*
|
|
52
|
+
* Example usage:
|
|
53
|
+
* ```ts snippet:ReadmeSampleSearchClient
|
|
54
|
+
* import { SearchClient, AzureKeyCredential } from "@azure/search-documents";
|
|
55
|
+
*
|
|
56
|
+
* const searchClient = new SearchClient(
|
|
57
|
+
* "<endpoint>",
|
|
58
|
+
* "<indexName>",
|
|
59
|
+
* new AzureKeyCredential("<apiKey>"),
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* Optionally, the type of the model can be used to enable strong typing and type hints:
|
|
64
|
+
* ```ts snippet:ReadmeSampleSearchClientWithModel
|
|
65
|
+
* import { SearchClient, AzureKeyCredential } from "@azure/search-documents";
|
|
66
|
+
*
|
|
67
|
+
* type TModel = {
|
|
68
|
+
* keyName: string;
|
|
69
|
+
* field1?: string | null;
|
|
70
|
+
* field2?: {
|
|
71
|
+
* anotherField?: string | null;
|
|
72
|
+
* } | null;
|
|
73
|
+
* };
|
|
74
|
+
*
|
|
75
|
+
* const searchClient = new SearchClient<TModel>(
|
|
76
|
+
* "<endpoint>",
|
|
77
|
+
* "<indexName>",
|
|
78
|
+
* new AzureKeyCredential("<apiKey>"),
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @param endpoint - The endpoint of the search service
|
|
83
|
+
* @param indexName - The name of the index
|
|
84
|
+
* @param credential - Used to authenticate requests to the service.
|
|
85
|
+
* @param options - Used to configure the Search client.
|
|
86
|
+
*
|
|
87
|
+
* @typeParam TModel - An optional type that represents the documents stored in
|
|
88
|
+
* the search index. For the best typing experience, all non-key fields should
|
|
89
|
+
* be marked optional and nullable, and the key property should have the
|
|
90
|
+
* non-nullable type `string`.
|
|
91
|
+
*/
|
|
92
|
+
constructor(endpoint, indexName, credential, options = {}) {
|
|
93
|
+
this.endpoint = endpoint;
|
|
94
|
+
this.indexName = indexName;
|
|
95
|
+
const internalClientPipelineOptions = {
|
|
96
|
+
...options,
|
|
97
|
+
...{
|
|
98
|
+
loggingOptions: {
|
|
99
|
+
logger: logger.info,
|
|
100
|
+
additionalAllowedHeaderNames: [
|
|
101
|
+
"elapsed-time",
|
|
102
|
+
"Location",
|
|
103
|
+
"OData-MaxVersion",
|
|
104
|
+
"OData-Version",
|
|
105
|
+
"Prefer",
|
|
106
|
+
"throttle-reason",
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
this.serviceVersion =
|
|
112
|
+
options.serviceVersion ?? options.apiVersion ?? utils.defaultServiceVersion;
|
|
113
|
+
this.apiVersion = this.serviceVersion;
|
|
114
|
+
this.client = new GeneratedClient(this.endpoint, credential, this.indexName, internalClientPipelineOptions);
|
|
115
|
+
this.pipeline = this.client.pipeline;
|
|
116
|
+
// Replaced with a custom policy below
|
|
117
|
+
this.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });
|
|
118
|
+
if (isTokenCredential(credential)) {
|
|
119
|
+
const scope = options.audience
|
|
120
|
+
? `${options.audience}/.default`
|
|
121
|
+
: `${KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
122
|
+
this.client.pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
|
|
104
123
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
this.client = new GeneratedClient(
|
|
110
|
-
this.endpoint,
|
|
111
|
-
credential,
|
|
112
|
-
this.indexName,
|
|
113
|
-
internalClientPipelineOptions
|
|
114
|
-
);
|
|
115
|
-
this.pipeline = this.client.pipeline;
|
|
116
|
-
this.pipeline.removePolicy({ name: bearerTokenAuthenticationPolicyName });
|
|
117
|
-
if (isTokenCredential(credential)) {
|
|
118
|
-
const scope = options.audience ? `${options.audience}/.default` : `${KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
119
|
-
this.client.pipeline.addPolicy(
|
|
120
|
-
bearerTokenAuthenticationPolicy({ credential, scopes: scope })
|
|
121
|
-
);
|
|
122
|
-
} else {
|
|
123
|
-
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
124
|
-
}
|
|
125
|
-
this.client.pipeline.addPolicy(createOdataMetadataPolicy("none"));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Retrieves the number of documents in the index.
|
|
129
|
-
* @param options - Options to the count operation.
|
|
130
|
-
*/
|
|
131
|
-
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
132
|
-
async getDocumentsCount(options = {}) {
|
|
133
|
-
return tracingClient.withSpan(
|
|
134
|
-
"SearchClient-getDocumentsCount",
|
|
135
|
-
options,
|
|
136
|
-
async (updatedOptions) => {
|
|
137
|
-
const response = await this.client.getDocumentCount(updatedOptions);
|
|
138
|
-
return Number(response);
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Based on a partial searchText from the user, return a list of potential completion strings
|
|
144
|
-
* based on a specified suggester.
|
|
145
|
-
* @param searchText - The search text on which to base autocomplete results.
|
|
146
|
-
* @param suggesterName - The name of the suggester as specified in the suggesters collection
|
|
147
|
-
* that's part of the index definition.
|
|
148
|
-
* @param options - Options to the autocomplete operation.
|
|
149
|
-
* @example
|
|
150
|
-
* ```ts snippet:ReadmeSampleAutocomplete
|
|
151
|
-
* import { SearchClient, AzureKeyCredential, SearchFieldArray } from "@azure/search-documents";
|
|
152
|
-
*
|
|
153
|
-
* type TModel = {
|
|
154
|
-
* key: string;
|
|
155
|
-
* azure?: {
|
|
156
|
-
* sdk: string | null;
|
|
157
|
-
* } | null;
|
|
158
|
-
* };
|
|
159
|
-
*
|
|
160
|
-
* const client = new SearchClient<TModel>(
|
|
161
|
-
* "endpoint.azure",
|
|
162
|
-
* "indexName",
|
|
163
|
-
* new AzureKeyCredential("key"),
|
|
164
|
-
* );
|
|
165
|
-
*
|
|
166
|
-
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
167
|
-
*
|
|
168
|
-
* const autocompleteResult = await client.autocomplete("searchText", "suggesterName", {
|
|
169
|
-
* searchFields,
|
|
170
|
-
* });
|
|
171
|
-
* ```
|
|
172
|
-
*/
|
|
173
|
-
async autocomplete(searchText, suggesterName, options = {}) {
|
|
174
|
-
if (!searchText) {
|
|
175
|
-
throw new RangeError("searchText must be provided.");
|
|
176
|
-
}
|
|
177
|
-
if (!suggesterName) {
|
|
178
|
-
throw new RangeError("suggesterName must be provided.");
|
|
124
|
+
else {
|
|
125
|
+
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
126
|
+
}
|
|
127
|
+
this.client.pipeline.addPolicy(createOdataMetadataPolicy("none"));
|
|
179
128
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
|
|
191
|
-
const {
|
|
192
|
-
includeTotalCount,
|
|
193
|
-
orderBy,
|
|
194
|
-
searchFields,
|
|
195
|
-
select,
|
|
196
|
-
speller,
|
|
197
|
-
highlightFields,
|
|
198
|
-
vectorSearchOptions,
|
|
199
|
-
semanticSearchOptions,
|
|
200
|
-
hybridSearch,
|
|
201
|
-
xMsQuerySourceAuthorization,
|
|
202
|
-
xMsEnableElevatedRead,
|
|
203
|
-
...restOptions
|
|
204
|
-
} = options;
|
|
205
|
-
const {
|
|
206
|
-
semanticFields,
|
|
207
|
-
configurationName,
|
|
208
|
-
errorMode,
|
|
209
|
-
answers,
|
|
210
|
-
captions,
|
|
211
|
-
debugMode,
|
|
212
|
-
queryRewrites,
|
|
213
|
-
...restSemanticOptions
|
|
214
|
-
} = semanticSearchOptions ?? {};
|
|
215
|
-
const { queries, filterMode, ...restVectorOptions } = vectorSearchOptions ?? {};
|
|
216
|
-
const fullOptions = {
|
|
217
|
-
...restSemanticOptions,
|
|
218
|
-
...restVectorOptions,
|
|
219
|
-
...restOptions,
|
|
220
|
-
...nextPageParameters,
|
|
221
|
-
searchFields: this.convertSearchFields(searchFields),
|
|
222
|
-
select: this.convertSelect(select) || "*",
|
|
223
|
-
querySpeller: speller,
|
|
224
|
-
semanticFields,
|
|
225
|
-
highlightFields: highlightFields?.split(","),
|
|
226
|
-
orderBy: this.convertOrderBy(orderBy),
|
|
227
|
-
includeTotalCount,
|
|
228
|
-
vectorQueries: queries?.map(this.convertVectorQuery.bind(this)),
|
|
229
|
-
answers: this.convertQueryAnswers(answers),
|
|
230
|
-
captions: this.convertQueryCaptions(captions),
|
|
231
|
-
semanticErrorHandling: errorMode,
|
|
232
|
-
semanticConfigurationName: configurationName,
|
|
233
|
-
debug: debugMode,
|
|
234
|
-
queryRewrites: this.convertQueryRewrites(queryRewrites),
|
|
235
|
-
vectorFilterMode: filterMode,
|
|
236
|
-
hybridSearch,
|
|
237
|
-
querySourceAuthorization: xMsQuerySourceAuthorization,
|
|
238
|
-
enableElevatedRead: xMsEnableElevatedRead
|
|
239
|
-
};
|
|
240
|
-
return tracingClient.withSpan(
|
|
241
|
-
"SearchClient-searchDocuments",
|
|
242
|
-
fullOptions,
|
|
243
|
-
async (updatedOptions) => {
|
|
244
|
-
const result = await this.client.searchPost({
|
|
245
|
-
...updatedOptions,
|
|
246
|
-
searchText
|
|
129
|
+
/**
|
|
130
|
+
* Retrieves the number of documents in the index.
|
|
131
|
+
* @param options - Options to the count operation.
|
|
132
|
+
*/
|
|
133
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
134
|
+
async getDocumentsCount(options = {}) {
|
|
135
|
+
return tracingClient.withSpan("SearchClient-getDocumentsCount", options, async (updatedOptions) => {
|
|
136
|
+
const count = await this.client.getDocumentCount(updatedOptions);
|
|
137
|
+
return Number(count);
|
|
247
138
|
});
|
|
248
|
-
const {
|
|
249
|
-
results,
|
|
250
|
-
nextLink,
|
|
251
|
-
nextPageParameters: resultNextPageParameters,
|
|
252
|
-
semanticPartialResponseReason: semanticErrorReason,
|
|
253
|
-
semanticPartialResponseType: semanticSearchResultsType,
|
|
254
|
-
facets,
|
|
255
|
-
answers: resultAnswers,
|
|
256
|
-
...restResult
|
|
257
|
-
} = result;
|
|
258
|
-
const modifiedResults = utils.generatedSearchResultToPublicSearchResult(
|
|
259
|
-
results
|
|
260
|
-
);
|
|
261
|
-
const converted = {
|
|
262
|
-
...restResult,
|
|
263
|
-
facets: utils.convertGeneratedFacetsToPublic(facets),
|
|
264
|
-
answers: utils.convertGeneratedAnswersToPublic(resultAnswers),
|
|
265
|
-
debugInfo: restResult.debugInfo,
|
|
266
|
-
results: modifiedResults,
|
|
267
|
-
semanticErrorReason,
|
|
268
|
-
semanticSearchResultsType,
|
|
269
|
-
continuationToken: this.encodeContinuationToken(nextLink, resultNextPageParameters)
|
|
270
|
-
};
|
|
271
|
-
return deserialize(converted);
|
|
272
|
-
}
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
async *listSearchResultsPage(searchText, options = {}, settings = {}) {
|
|
276
|
-
let decodedContinuation = this.decodeContinuationToken(settings.continuationToken);
|
|
277
|
-
let result = await this.searchDocuments(
|
|
278
|
-
searchText,
|
|
279
|
-
options,
|
|
280
|
-
decodedContinuation?.nextPageParameters
|
|
281
|
-
);
|
|
282
|
-
yield result;
|
|
283
|
-
while (result.continuationToken) {
|
|
284
|
-
decodedContinuation = this.decodeContinuationToken(result.continuationToken);
|
|
285
|
-
result = await this.searchDocuments(
|
|
286
|
-
searchText,
|
|
287
|
-
options,
|
|
288
|
-
decodedContinuation?.nextPageParameters
|
|
289
|
-
);
|
|
290
|
-
yield result;
|
|
291
139
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Based on a partial searchText from the user, return a list of potential completion strings
|
|
142
|
+
* based on a specified suggester.
|
|
143
|
+
* @param searchText - The search text on which to base autocomplete results.
|
|
144
|
+
* @param suggesterName - The name of the suggester as specified in the suggesters collection
|
|
145
|
+
* that's part of the index definition.
|
|
146
|
+
* @param options - Options to the autocomplete operation.
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts snippet:ReadmeSampleAutocomplete
|
|
149
|
+
* import { SearchClient, AzureKeyCredential, SearchFieldArray } from "@azure/search-documents";
|
|
150
|
+
*
|
|
151
|
+
* type TModel = {
|
|
152
|
+
* key: string;
|
|
153
|
+
* azure?: {
|
|
154
|
+
* sdk: string | null;
|
|
155
|
+
* } | null;
|
|
156
|
+
* };
|
|
157
|
+
*
|
|
158
|
+
* const client = new SearchClient<TModel>(
|
|
159
|
+
* "endpoint.azure",
|
|
160
|
+
* "indexName",
|
|
161
|
+
* new AzureKeyCredential("key"),
|
|
162
|
+
* );
|
|
163
|
+
*
|
|
164
|
+
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
165
|
+
*
|
|
166
|
+
* const autocompleteResult = await client.autocomplete("searchText", "suggesterName", {
|
|
167
|
+
* searchFields,
|
|
168
|
+
* });
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
async autocomplete(searchText, suggesterName, options = {}) {
|
|
172
|
+
if (!searchText) {
|
|
173
|
+
throw new RangeError("searchText must be provided.");
|
|
174
|
+
}
|
|
175
|
+
if (!suggesterName) {
|
|
176
|
+
throw new RangeError("suggesterName must be provided.");
|
|
177
|
+
}
|
|
178
|
+
const { searchFields, ...restOptions } = options;
|
|
179
|
+
return tracingClient.withSpan("SearchClient-autocomplete", options, async (updatedOptions) => {
|
|
180
|
+
return this.client.autocompletePost(searchText, suggesterName, {
|
|
181
|
+
...updatedOptions,
|
|
182
|
+
...restOptions,
|
|
183
|
+
// Cast readonly array to mutable - the generated code doesn't mutate it
|
|
184
|
+
searchFields: searchFields,
|
|
185
|
+
});
|
|
186
|
+
});
|
|
301
187
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
* const searchResult = await client.search("searchText", {
|
|
343
|
-
* select,
|
|
344
|
-
* searchFields,
|
|
345
|
-
* });
|
|
346
|
-
* ```
|
|
347
|
-
*/
|
|
348
|
-
async search(searchText, options = {}) {
|
|
349
|
-
return tracingClient.withSpan("SearchClient-search", options, async (updatedOptions) => {
|
|
350
|
-
const pageResult = await this.searchDocuments(searchText, updatedOptions);
|
|
351
|
-
return {
|
|
352
|
-
...pageResult,
|
|
353
|
-
results: this.listSearchResults(pageResult, searchText, updatedOptions)
|
|
354
|
-
};
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Returns a short list of suggestions based on the searchText and specified suggester.
|
|
359
|
-
* @param searchText - The search text to use to suggest documents. Must be at least 1 character,
|
|
360
|
-
* and no more than 100 characters.
|
|
361
|
-
* @param suggesterName - The name of the suggester as specified in the suggesters collection
|
|
362
|
-
* that's part of the index definition.
|
|
363
|
-
* @param options - Options for the suggest operation
|
|
364
|
-
* @example
|
|
365
|
-
* ```ts snippet:ReadmeSampleSuggest
|
|
366
|
-
* import { SearchClient, AzureKeyCredential, SearchFieldArray } from "@azure/search-documents";
|
|
367
|
-
*
|
|
368
|
-
* type TModel = {
|
|
369
|
-
* key: string;
|
|
370
|
-
* azure?: {
|
|
371
|
-
* sdk: string | null;
|
|
372
|
-
* } | null;
|
|
373
|
-
* };
|
|
374
|
-
*
|
|
375
|
-
* const client = new SearchClient<TModel>(
|
|
376
|
-
* "endpoint.azure",
|
|
377
|
-
* "indexName",
|
|
378
|
-
* new AzureKeyCredential("key"),
|
|
379
|
-
* );
|
|
380
|
-
*
|
|
381
|
-
* const select = ["azure/sdk"] as const;
|
|
382
|
-
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
383
|
-
*
|
|
384
|
-
* const suggestResult = await client.suggest("searchText", "suggesterName", {
|
|
385
|
-
* select,
|
|
386
|
-
* searchFields,
|
|
387
|
-
* });
|
|
388
|
-
* ```
|
|
389
|
-
*/
|
|
390
|
-
async suggest(searchText, suggesterName, options = {}) {
|
|
391
|
-
const { select, searchFields, orderBy, ...nonFieldOptions } = options;
|
|
392
|
-
const fullOptions = {
|
|
393
|
-
// Cast readonly arrays to mutable - the generated code doesn't mutate them
|
|
394
|
-
searchFields: this.convertSearchFields(searchFields),
|
|
395
|
-
select: this.convertSelect(select),
|
|
396
|
-
orderBy: this.convertOrderBy(orderBy),
|
|
397
|
-
...nonFieldOptions
|
|
398
|
-
};
|
|
399
|
-
if (!searchText) {
|
|
400
|
-
throw new RangeError("searchText must be provided.");
|
|
188
|
+
async searchDocuments(searchText, options = {}, nextPageParameters = {}) {
|
|
189
|
+
const { includeTotalCount, orderBy, searchFields, select, highlightFields, vectorSearchOptions, semanticSearchOptions, debug, ...restOptions } = options;
|
|
190
|
+
const { semanticFields, configurationName, errorMode, answers, captions, debugMode, ...restSemanticOptions } = semanticSearchOptions ?? {};
|
|
191
|
+
const { queries, filterMode, ...restVectorOptions } = vectorSearchOptions ?? {};
|
|
192
|
+
const fullOptions = {
|
|
193
|
+
...restSemanticOptions,
|
|
194
|
+
...restVectorOptions,
|
|
195
|
+
...restOptions,
|
|
196
|
+
...nextPageParameters,
|
|
197
|
+
searchFields: this.convertSearchFields(searchFields),
|
|
198
|
+
select: this.convertSelect(select) || "*",
|
|
199
|
+
highlightFields: highlightFields?.split(","),
|
|
200
|
+
orderBy: this.convertOrderBy(orderBy),
|
|
201
|
+
includeTotalCount,
|
|
202
|
+
vectorQueries: queries?.map(this.convertVectorQuery.bind(this)),
|
|
203
|
+
answers: this.convertQueryAnswers(answers),
|
|
204
|
+
captions: this.convertQueryCaptions(captions),
|
|
205
|
+
semanticErrorHandling: errorMode,
|
|
206
|
+
semanticConfigurationName: configurationName,
|
|
207
|
+
debug: debugMode ?? debug, // Use semanticSearchOptions.debugMode if set, otherwise use top-level debug
|
|
208
|
+
vectorFilterMode: filterMode,
|
|
209
|
+
};
|
|
210
|
+
return tracingClient.withSpan("SearchClient-searchDocuments", fullOptions, async (updatedOptions) => {
|
|
211
|
+
const result = await this.client.searchPost({
|
|
212
|
+
...updatedOptions,
|
|
213
|
+
searchText: searchText,
|
|
214
|
+
});
|
|
215
|
+
const { results, nextLink, nextPageParameters: resultNextPageParameters, semanticPartialResponseReason: semanticErrorReason, semanticPartialResponseType: semanticSearchResultsType, facets, answers: resultAnswers, ...restResult } = result;
|
|
216
|
+
const modifiedResults = utils.generatedSearchResultToPublicSearchResult(results);
|
|
217
|
+
const converted = {
|
|
218
|
+
...restResult,
|
|
219
|
+
facets: utils.convertGeneratedFacetsToPublic(facets),
|
|
220
|
+
answers: utils.convertGeneratedAnswersToPublic(resultAnswers),
|
|
221
|
+
results: modifiedResults,
|
|
222
|
+
semanticErrorReason,
|
|
223
|
+
semanticSearchResultsType,
|
|
224
|
+
continuationToken: this.encodeContinuationToken(nextLink, resultNextPageParameters),
|
|
225
|
+
};
|
|
226
|
+
return deserialize(converted);
|
|
227
|
+
});
|
|
401
228
|
}
|
|
402
|
-
|
|
403
|
-
|
|
229
|
+
async *listSearchResultsPage(searchText, options = {}, settings = {}) {
|
|
230
|
+
let decodedContinuation = this.decodeContinuationToken(settings.continuationToken);
|
|
231
|
+
let result = await this.searchDocuments(searchText, options, decodedContinuation?.nextPageParameters);
|
|
232
|
+
yield result;
|
|
233
|
+
// Technically, we should also leverage nextLink, but the generated code
|
|
234
|
+
// doesn't support this yet.
|
|
235
|
+
while (result.continuationToken) {
|
|
236
|
+
decodedContinuation = this.decodeContinuationToken(result.continuationToken);
|
|
237
|
+
result = await this.searchDocuments(searchText, options, decodedContinuation?.nextPageParameters);
|
|
238
|
+
yield result;
|
|
239
|
+
}
|
|
404
240
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
* Retrieve a particular document from the index by key.
|
|
413
|
-
* @param key - The primary key value of the document
|
|
414
|
-
* @param options - Additional options
|
|
415
|
-
*/
|
|
416
|
-
async getDocument(key, options = {}) {
|
|
417
|
-
return tracingClient.withSpan(
|
|
418
|
-
"SearchClient-getDocument",
|
|
419
|
-
options,
|
|
420
|
-
async (updatedOptions) => {
|
|
421
|
-
const result = await this.client.getDocument(key, {
|
|
422
|
-
...updatedOptions,
|
|
423
|
-
selectedFields: updatedOptions.selectedFields
|
|
424
|
-
});
|
|
425
|
-
return deserialize(result.additionalProperties ?? {});
|
|
426
|
-
}
|
|
427
|
-
);
|
|
428
|
-
}
|
|
429
|
-
/**
|
|
430
|
-
* Perform a set of index modifications (upload, merge, mergeOrUpload, delete)
|
|
431
|
-
* for the given set of documents.
|
|
432
|
-
* This operation may partially succeed and not all document operations will
|
|
433
|
-
* be reflected in the index. If you would like to treat this as an exception,
|
|
434
|
-
* set the `throwOnAnyFailure` option to true.
|
|
435
|
-
* For more details about how merging works, see: https://learn.microsoft.com/rest/api/searchservice/AddUpdate-or-Delete-Documents
|
|
436
|
-
* @param batch - An array of actions to perform on the index.
|
|
437
|
-
* @param options - Additional options.
|
|
438
|
-
*/
|
|
439
|
-
async indexDocuments(batch, options = {}) {
|
|
440
|
-
return tracingClient.withSpan(
|
|
441
|
-
"SearchClient-indexDocuments",
|
|
442
|
-
options,
|
|
443
|
-
async (updatedOptions) => {
|
|
444
|
-
let status = 0;
|
|
445
|
-
const serializedActions = serialize(batch.actions);
|
|
446
|
-
const result = await this.client.index(
|
|
447
|
-
{ actions: utils.convertPublicActionsToGeneratedActions(serializedActions) },
|
|
448
|
-
{
|
|
449
|
-
...updatedOptions,
|
|
450
|
-
onResponse: (rawResponse, flatResponse) => {
|
|
451
|
-
status = rawResponse.status;
|
|
452
|
-
if (updatedOptions.onResponse) {
|
|
453
|
-
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
454
|
-
}
|
|
241
|
+
async *listSearchResultsAll(firstPage, searchText, options = {}) {
|
|
242
|
+
yield* firstPage.results;
|
|
243
|
+
if (firstPage.continuationToken) {
|
|
244
|
+
for await (const page of this.listSearchResultsPage(searchText, options, {
|
|
245
|
+
continuationToken: firstPage.continuationToken,
|
|
246
|
+
})) {
|
|
247
|
+
yield* page.results;
|
|
455
248
|
}
|
|
456
|
-
}
|
|
457
|
-
);
|
|
458
|
-
if (options.throwOnAnyFailure && status === 207) {
|
|
459
|
-
throw result;
|
|
460
|
-
}
|
|
461
|
-
return result;
|
|
462
|
-
}
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
/**
|
|
466
|
-
* Upload an array of documents to the index.
|
|
467
|
-
* @param documents - The documents to upload.
|
|
468
|
-
* @param options - Additional options.
|
|
469
|
-
*/
|
|
470
|
-
async uploadDocuments(documents, options = {}) {
|
|
471
|
-
return tracingClient.withSpan(
|
|
472
|
-
"SearchClient-uploadDocuments",
|
|
473
|
-
options,
|
|
474
|
-
async (updatedOptions) => {
|
|
475
|
-
const batch = new IndexDocumentsBatch();
|
|
476
|
-
batch.upload(documents);
|
|
477
|
-
return this.indexDocuments(batch, updatedOptions);
|
|
478
|
-
}
|
|
479
|
-
);
|
|
480
|
-
}
|
|
481
|
-
/**
|
|
482
|
-
* Update a set of documents in the index.
|
|
483
|
-
*
|
|
484
|
-
* For more details about how merging works, see
|
|
485
|
-
* https://learn.microsoft.com/rest/api/searchservice/AddUpdate-or-Delete-Documents
|
|
486
|
-
* @param documents - The updated documents.
|
|
487
|
-
* @param options - Additional options.
|
|
488
|
-
*/
|
|
489
|
-
async mergeDocuments(documents, options = {}) {
|
|
490
|
-
return tracingClient.withSpan(
|
|
491
|
-
"SearchClient-mergeDocuments",
|
|
492
|
-
options,
|
|
493
|
-
async (updatedOptions) => {
|
|
494
|
-
const batch = new IndexDocumentsBatch();
|
|
495
|
-
batch.merge(documents);
|
|
496
|
-
return this.indexDocuments(batch, updatedOptions);
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Update a set of documents in the index or upload them if they don't exist.
|
|
502
|
-
*
|
|
503
|
-
* For more details about how merging works, see
|
|
504
|
-
* https://learn.microsoft.com/rest/api/searchservice/AddUpdate-or-Delete-Documents
|
|
505
|
-
* @param documents - The updated documents.
|
|
506
|
-
* @param options - Additional options.
|
|
507
|
-
*/
|
|
508
|
-
async mergeOrUploadDocuments(documents, options = {}) {
|
|
509
|
-
return tracingClient.withSpan(
|
|
510
|
-
"SearchClient-mergeOrUploadDocuments",
|
|
511
|
-
options,
|
|
512
|
-
async (updatedOptions) => {
|
|
513
|
-
const batch = new IndexDocumentsBatch();
|
|
514
|
-
batch.mergeOrUpload(documents);
|
|
515
|
-
return this.indexDocuments(batch, updatedOptions);
|
|
516
|
-
}
|
|
517
|
-
);
|
|
518
|
-
}
|
|
519
|
-
async deleteDocuments(keyNameOrDocuments, keyValuesOrOptions, options = {}) {
|
|
520
|
-
return tracingClient.withSpan(
|
|
521
|
-
"SearchClient-deleteDocuments",
|
|
522
|
-
options,
|
|
523
|
-
async (updatedOptions) => {
|
|
524
|
-
const batch = new IndexDocumentsBatch();
|
|
525
|
-
if (typeof keyNameOrDocuments === "string") {
|
|
526
|
-
batch.delete(keyNameOrDocuments, keyValuesOrOptions);
|
|
527
|
-
} else {
|
|
528
|
-
batch.delete(keyNameOrDocuments);
|
|
529
249
|
}
|
|
530
|
-
return this.indexDocuments(batch, updatedOptions);
|
|
531
|
-
}
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
encodeContinuationToken(nextLink, nextPageParameters) {
|
|
535
|
-
if (!nextLink || !nextPageParameters) {
|
|
536
|
-
return void 0;
|
|
537
250
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
251
|
+
listSearchResults(firstPage, searchText, options = {}) {
|
|
252
|
+
const iter = this.listSearchResultsAll(firstPage, searchText, options);
|
|
253
|
+
return {
|
|
254
|
+
next() {
|
|
255
|
+
return iter.next();
|
|
256
|
+
},
|
|
257
|
+
[Symbol.asyncIterator]() {
|
|
258
|
+
return this;
|
|
259
|
+
},
|
|
260
|
+
byPage: (settings = {}) => {
|
|
261
|
+
return this.listSearchResultsPage(searchText, options, settings);
|
|
262
|
+
},
|
|
263
|
+
};
|
|
548
264
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
265
|
+
/**
|
|
266
|
+
* Performs a search on the current index given
|
|
267
|
+
* the specified arguments.
|
|
268
|
+
* @param searchText - Text to search
|
|
269
|
+
* @param options - Options for the search operation.
|
|
270
|
+
* @example
|
|
271
|
+
* ```ts snippet:ReadmeSampleSearchTModel
|
|
272
|
+
* import { SearchClient, AzureKeyCredential, SearchFieldArray } from "@azure/search-documents";
|
|
273
|
+
*
|
|
274
|
+
* type TModel = {
|
|
275
|
+
* key: string;
|
|
276
|
+
* azure?: {
|
|
277
|
+
* sdk: string | null;
|
|
278
|
+
* } | null;
|
|
279
|
+
* };
|
|
280
|
+
*
|
|
281
|
+
* const client = new SearchClient<TModel>(
|
|
282
|
+
* "endpoint.azure",
|
|
283
|
+
* "indexName",
|
|
284
|
+
* new AzureKeyCredential("key"),
|
|
285
|
+
* );
|
|
286
|
+
*
|
|
287
|
+
* const select = ["azure/sdk"] as const;
|
|
288
|
+
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
289
|
+
*
|
|
290
|
+
* const searchResult = await client.search("searchText", {
|
|
291
|
+
* select,
|
|
292
|
+
* searchFields,
|
|
293
|
+
* });
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
async search(searchText, options = {}) {
|
|
297
|
+
return tracingClient.withSpan("SearchClient-search", options, async (updatedOptions) => {
|
|
298
|
+
const pageResult = await this.searchDocuments(searchText, updatedOptions);
|
|
299
|
+
return {
|
|
300
|
+
...pageResult,
|
|
301
|
+
results: this.listSearchResults(pageResult, searchText, updatedOptions),
|
|
302
|
+
};
|
|
303
|
+
});
|
|
561
304
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
305
|
+
/**
|
|
306
|
+
* Returns a short list of suggestions based on the searchText and specified suggester.
|
|
307
|
+
* @param searchText - The search text to use to suggest documents. Must be at least 1 character,
|
|
308
|
+
* and no more than 100 characters.
|
|
309
|
+
* @param suggesterName - The name of the suggester as specified in the suggesters collection
|
|
310
|
+
* that's part of the index definition.
|
|
311
|
+
* @param options - Options for the suggest operation
|
|
312
|
+
* @example
|
|
313
|
+
* ```ts snippet:ReadmeSampleSuggest
|
|
314
|
+
* import { SearchClient, AzureKeyCredential, SearchFieldArray } from "@azure/search-documents";
|
|
315
|
+
*
|
|
316
|
+
* type TModel = {
|
|
317
|
+
* key: string;
|
|
318
|
+
* azure?: {
|
|
319
|
+
* sdk: string | null;
|
|
320
|
+
* } | null;
|
|
321
|
+
* };
|
|
322
|
+
*
|
|
323
|
+
* const client = new SearchClient<TModel>(
|
|
324
|
+
* "endpoint.azure",
|
|
325
|
+
* "indexName",
|
|
326
|
+
* new AzureKeyCredential("key"),
|
|
327
|
+
* );
|
|
328
|
+
*
|
|
329
|
+
* const select = ["azure/sdk"] as const;
|
|
330
|
+
* const searchFields: SearchFieldArray<TModel> = ["azure/sdk"];
|
|
331
|
+
*
|
|
332
|
+
* const suggestResult = await client.suggest("searchText", "suggesterName", {
|
|
333
|
+
* select,
|
|
334
|
+
* searchFields,
|
|
335
|
+
* });
|
|
336
|
+
* ```
|
|
337
|
+
*/
|
|
338
|
+
async suggest(searchText, suggesterName, options = {}) {
|
|
339
|
+
const { select, searchFields, orderBy, ...nonFieldOptions } = options;
|
|
340
|
+
const fullOptions = {
|
|
341
|
+
// Cast readonly arrays to mutable - the generated code doesn't mutate them
|
|
342
|
+
searchFields: this.convertSearchFields(searchFields),
|
|
343
|
+
select: this.convertSelect(select),
|
|
344
|
+
orderBy: this.convertOrderBy(orderBy),
|
|
345
|
+
...nonFieldOptions,
|
|
346
|
+
};
|
|
347
|
+
if (!searchText) {
|
|
348
|
+
throw new RangeError("searchText must be provided.");
|
|
349
|
+
}
|
|
350
|
+
if (!suggesterName) {
|
|
351
|
+
throw new RangeError("suggesterName must be provided.");
|
|
352
|
+
}
|
|
353
|
+
return tracingClient.withSpan("SearchClient-suggest", fullOptions, async (updatedOptions) => {
|
|
354
|
+
const result = await this.client.suggestPost(searchText, suggesterName, updatedOptions);
|
|
355
|
+
const modifiedResult = utils.generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(result);
|
|
356
|
+
return deserialize(modifiedResult);
|
|
357
|
+
});
|
|
566
358
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
359
|
+
/**
|
|
360
|
+
* Retrieve a particular document from the index by key.
|
|
361
|
+
* @param key - The primary key value of the document
|
|
362
|
+
* @param options - Additional options
|
|
363
|
+
*/
|
|
364
|
+
async getDocument(key, options = {}) {
|
|
365
|
+
return tracingClient.withSpan("SearchClient-getDocument", options, async (updatedOptions) => {
|
|
366
|
+
const result = await this.client.getDocument(key, {
|
|
367
|
+
...updatedOptions,
|
|
368
|
+
selectedFields: updatedOptions.selectedFields,
|
|
369
|
+
});
|
|
370
|
+
// The generated code puts document fields in additionalProperties
|
|
371
|
+
return deserialize(result.additionalProperties ?? {});
|
|
372
|
+
});
|
|
572
373
|
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
374
|
+
/**
|
|
375
|
+
* Perform a set of index modifications (upload, merge, mergeOrUpload, delete)
|
|
376
|
+
* for the given set of documents.
|
|
377
|
+
* This operation may partially succeed and not all document operations will
|
|
378
|
+
* be reflected in the index. If you would like to treat this as an exception,
|
|
379
|
+
* set the `throwOnAnyFailure` option to true.
|
|
380
|
+
* For more details about how merging works, see: https://learn.microsoft.com/rest/api/searchservice/AddUpdate-or-Delete-Documents
|
|
381
|
+
* @param batch - An array of actions to perform on the index.
|
|
382
|
+
* @param options - Additional options.
|
|
383
|
+
*/
|
|
384
|
+
async indexDocuments(
|
|
385
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters
|
|
386
|
+
batch, options = {}) {
|
|
387
|
+
return tracingClient.withSpan("SearchClient-indexDocuments", options, async (updatedOptions) => {
|
|
388
|
+
let status = 0;
|
|
389
|
+
const serializedActions = serialize(batch.actions);
|
|
390
|
+
const result = await this.client.index({ actions: utils.convertPublicActionsToGeneratedActions(serializedActions) }, {
|
|
391
|
+
...updatedOptions,
|
|
392
|
+
onResponse: (rawResponse, flatResponse) => {
|
|
393
|
+
status = rawResponse.status;
|
|
394
|
+
if (updatedOptions.onResponse) {
|
|
395
|
+
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
if (options.throwOnAnyFailure && status === 207) {
|
|
400
|
+
throw result;
|
|
401
|
+
}
|
|
402
|
+
return result;
|
|
403
|
+
});
|
|
578
404
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
405
|
+
/**
|
|
406
|
+
* Upload an array of documents to the index.
|
|
407
|
+
* @param documents - The documents to upload.
|
|
408
|
+
* @param options - Additional options.
|
|
409
|
+
*/
|
|
410
|
+
async uploadDocuments(documents, options = {}) {
|
|
411
|
+
return tracingClient.withSpan("SearchClient-uploadDocuments", options, async (updatedOptions) => {
|
|
412
|
+
const batch = new IndexDocumentsBatch();
|
|
413
|
+
batch.upload(documents);
|
|
414
|
+
return this.indexDocuments(batch, updatedOptions);
|
|
415
|
+
});
|
|
584
416
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
417
|
+
/**
|
|
418
|
+
* Update a set of documents in the index.
|
|
419
|
+
*
|
|
420
|
+
* For more details about how merging works, see
|
|
421
|
+
* https://learn.microsoft.com/rest/api/searchservice/AddUpdate-or-Delete-Documents
|
|
422
|
+
* @param documents - The updated documents.
|
|
423
|
+
* @param options - Additional options.
|
|
424
|
+
*/
|
|
425
|
+
async mergeDocuments(documents, options = {}) {
|
|
426
|
+
return tracingClient.withSpan("SearchClient-mergeDocuments", options, async (updatedOptions) => {
|
|
427
|
+
const batch = new IndexDocumentsBatch();
|
|
428
|
+
batch.merge(documents);
|
|
429
|
+
return this.indexDocuments(batch, updatedOptions);
|
|
430
|
+
});
|
|
590
431
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
432
|
+
/**
|
|
433
|
+
* Update a set of documents in the index or upload them if they don't exist.
|
|
434
|
+
*
|
|
435
|
+
* For more details about how merging works, see
|
|
436
|
+
* https://learn.microsoft.com/rest/api/searchservice/AddUpdate-or-Delete-Documents
|
|
437
|
+
* @param documents - The updated documents.
|
|
438
|
+
* @param options - Additional options.
|
|
439
|
+
*/
|
|
440
|
+
async mergeOrUploadDocuments(documents, options = {}) {
|
|
441
|
+
return tracingClient.withSpan("SearchClient-mergeOrUploadDocuments", options, async (updatedOptions) => {
|
|
442
|
+
const batch = new IndexDocumentsBatch();
|
|
443
|
+
batch.mergeOrUpload(documents);
|
|
444
|
+
return this.indexDocuments(batch, updatedOptions);
|
|
445
|
+
});
|
|
595
446
|
}
|
|
596
|
-
|
|
597
|
-
|
|
447
|
+
async deleteDocuments(keyNameOrDocuments, keyValuesOrOptions, options = {}) {
|
|
448
|
+
return tracingClient.withSpan("SearchClient-deleteDocuments", options, async (updatedOptions) => {
|
|
449
|
+
const batch = new IndexDocumentsBatch();
|
|
450
|
+
if (typeof keyNameOrDocuments === "string") {
|
|
451
|
+
batch.delete(keyNameOrDocuments, keyValuesOrOptions);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
batch.delete(keyNameOrDocuments);
|
|
455
|
+
}
|
|
456
|
+
return this.indexDocuments(batch, updatedOptions);
|
|
457
|
+
});
|
|
598
458
|
}
|
|
599
|
-
|
|
600
|
-
|
|
459
|
+
encodeContinuationToken(nextLink, nextPageParameters) {
|
|
460
|
+
if (!nextLink || !nextPageParameters) {
|
|
461
|
+
return undefined;
|
|
462
|
+
}
|
|
463
|
+
const payload = JSON.stringify({
|
|
464
|
+
apiVersion: this.apiVersion,
|
|
465
|
+
nextLink,
|
|
466
|
+
nextPageParameters,
|
|
467
|
+
});
|
|
468
|
+
return encode(payload);
|
|
601
469
|
}
|
|
602
|
-
|
|
603
|
-
|
|
470
|
+
decodeContinuationToken(token) {
|
|
471
|
+
if (!token) {
|
|
472
|
+
return undefined;
|
|
473
|
+
}
|
|
474
|
+
const decodedToken = decode(token);
|
|
475
|
+
try {
|
|
476
|
+
const result = JSON.parse(decodedToken);
|
|
477
|
+
if (result.apiVersion !== this.apiVersion) {
|
|
478
|
+
throw new RangeError(`Continuation token uses unsupported apiVersion "${this.apiVersion}"`);
|
|
479
|
+
}
|
|
480
|
+
return {
|
|
481
|
+
nextLink: result.nextLink,
|
|
482
|
+
nextPageParameters: result.nextPageParameters,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
catch (e) {
|
|
486
|
+
throw new Error(`Corrupted or invalid continuation token: ${decodedToken}`);
|
|
487
|
+
}
|
|
604
488
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
489
|
+
convertSelect(select) {
|
|
490
|
+
if (select) {
|
|
491
|
+
return select.join(",");
|
|
492
|
+
}
|
|
493
|
+
return undefined;
|
|
610
494
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
495
|
+
convertVectorQueryFields(fields) {
|
|
496
|
+
if (fields) {
|
|
497
|
+
return fields.join(",");
|
|
498
|
+
}
|
|
499
|
+
return undefined;
|
|
615
500
|
}
|
|
616
|
-
|
|
617
|
-
|
|
501
|
+
convertSearchFields(searchFields) {
|
|
502
|
+
if (searchFields) {
|
|
503
|
+
return searchFields.join(",");
|
|
504
|
+
}
|
|
505
|
+
return undefined;
|
|
618
506
|
}
|
|
619
|
-
|
|
620
|
-
|
|
507
|
+
convertOrderBy(orderBy) {
|
|
508
|
+
if (orderBy) {
|
|
509
|
+
return orderBy.join(",");
|
|
510
|
+
}
|
|
511
|
+
return undefined;
|
|
621
512
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
const {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
return vectorQuery;
|
|
642
|
-
}
|
|
513
|
+
convertQueryAnswers(answers) {
|
|
514
|
+
if (!answers) {
|
|
515
|
+
return undefined;
|
|
516
|
+
}
|
|
517
|
+
const config = [];
|
|
518
|
+
const { answerType: output, count, threshold, maxAnswerLength } = answers;
|
|
519
|
+
if (count) {
|
|
520
|
+
config.push(`count-${count}`);
|
|
521
|
+
}
|
|
522
|
+
if (threshold) {
|
|
523
|
+
config.push(`threshold-${threshold}`);
|
|
524
|
+
}
|
|
525
|
+
if (maxAnswerLength) {
|
|
526
|
+
config.push(`maxcharlength-${maxAnswerLength}`);
|
|
527
|
+
}
|
|
528
|
+
if (config.length) {
|
|
529
|
+
return output + `|${config.join(",")}`;
|
|
530
|
+
}
|
|
531
|
+
return output;
|
|
643
532
|
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
533
|
+
convertQueryCaptions(captions) {
|
|
534
|
+
if (!captions) {
|
|
535
|
+
return undefined;
|
|
536
|
+
}
|
|
537
|
+
const config = [];
|
|
538
|
+
const { captionType: output, highlight, maxCaptionLength } = captions;
|
|
539
|
+
if (highlight !== undefined) {
|
|
540
|
+
config.push(`highlight-${highlight}`);
|
|
541
|
+
}
|
|
542
|
+
if (maxCaptionLength) {
|
|
543
|
+
config.push(`maxcharlength-${maxCaptionLength}`);
|
|
544
|
+
}
|
|
545
|
+
if (config.length) {
|
|
546
|
+
return output + `|${config.join(",")}`;
|
|
547
|
+
}
|
|
548
|
+
return output;
|
|
648
549
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
550
|
+
convertVectorQuery(vectorQuery) {
|
|
551
|
+
switch (vectorQuery.kind) {
|
|
552
|
+
case "text": {
|
|
553
|
+
const { fields, ...restFields } = vectorQuery;
|
|
554
|
+
return {
|
|
555
|
+
...restFields,
|
|
556
|
+
fields: this.convertVectorQueryFields(fields),
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
case "vector":
|
|
560
|
+
case "imageUrl": {
|
|
561
|
+
return { ...vectorQuery, fields: this.convertVectorQueryFields(vectorQuery?.fields) };
|
|
562
|
+
}
|
|
563
|
+
case "imageBinary": {
|
|
564
|
+
// Map convenience layer's binaryImage to generated layer's base64Image
|
|
565
|
+
const { binaryImage, fields, ...rest } = vectorQuery;
|
|
566
|
+
return {
|
|
567
|
+
...rest,
|
|
568
|
+
base64Image: binaryImage,
|
|
569
|
+
fields: this.convertVectorQueryFields(fields),
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
default: {
|
|
573
|
+
logger.warning("Unknown vector query kind; sending without serialization");
|
|
574
|
+
return vectorQuery;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
659
577
|
}
|
|
660
|
-
}
|
|
661
578
|
}
|
|
662
|
-
|
|
663
|
-
SearchClient
|
|
664
|
-
};
|
|
579
|
+
//# sourceMappingURL=searchClient.js.map
|