From f8bf25b25ab5602fa3d077799435afc75b3e0c2b Mon Sep 17 00:00:00 2001 From: Mohit Chakraborty Date: Thu, 4 Feb 2021 21:01:54 -0800 Subject: [PATCH 1/3] Ensure only a single action for a document is added to a batch --- .../Azure.Search.Documents/src/Batching/Publisher.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/search/Azure.Search.Documents/src/Batching/Publisher.cs b/sdk/search/Azure.Search.Documents/src/Batching/Publisher.cs index 8f7e0fd794d2..52267ec5f6d2 100644 --- a/sdk/search/Azure.Search.Documents/src/Batching/Publisher.cs +++ b/sdk/search/Azure.Search.Documents/src/Batching/Publisher.cs @@ -422,12 +422,14 @@ await SubmitBatchAsync( // Returns whether the batch is now full. bool FillBatchFromQueue(List> batch, Queue< PublisherAction> queue) { - // TODO: Consider tracking the keys in the batch and requiring - // them to be unique to avoid error alignment problems + HashSet documentIdentifiers = new HashSet(StringComparer.Ordinal); while (queue.Count > 0) { - if (batch.Count < BatchActionCount) + // Stop filling the batch if we run into an action for a document that is already in the batch. + // We want to keep the actions ordered and map any errors accurately to the documents, + // so we need to split the batch on encountering an action for a previously queued document. + if ((batch.Count < BatchActionCount) && documentIdentifiers.Add(queue.Peek().Key)) { batch.Add(queue.Dequeue()); } From 48db0c8b6c31d9e1b3d7b860e13f7604960aae9c Mon Sep 17 00:00:00 2001 From: Mohit Chakraborty Date: Fri, 5 Feb 2021 11:17:03 -0800 Subject: [PATCH 2/3] Add test to validate batch splitting behavior --- .../tests/Batching/BatchingTests.cs | 59 ++++++ .../Behavior_SplitBatchByDocumentKey.json | 174 ++++++++++++++++++ ...Behavior_SplitBatchByDocumentKeyAsync.json | 174 ++++++++++++++++++ 3 files changed, 407 insertions(+) create mode 100644 sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json create mode 100644 sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json diff --git a/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs b/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs index e8966c6f9e73..74855ae4a79d 100644 --- a/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs @@ -1031,6 +1031,65 @@ public async Task Behavior_BatchSize() Assert.AreEqual(5, client.Submissions.Count); } + [Test] + public async Task Behavior_SplitBatchByDocumentKey() + { + int numberOfDocuments = 5; + + await using SearchResources resources = await SearchResources.CreateWithEmptyIndexAsync(this); + BatchingSearchClient client = GetBatchingSearchClient(resources); + + SimpleDocument[] data = new SimpleDocument[numberOfDocuments]; + for (int i = 0; i < numberOfDocuments; i++) + { + data[i] = new SimpleDocument() { Id = $"{i}", Name = $"Document #{i}" }; + } + + // 'SimpleDocument' has 'Id' set as its key field. + // Set the Ids of 2 documents in the group to be the same. + // We expect the batch to be split at this index, even though the size of the set is smaller than the batch size. + data[3].Id = data[0].Id; + + await using SearchIndexingBufferedSender indexer = + client.CreateIndexingBufferedSender( + new SearchIndexingBufferedSenderOptions() + { + // Set the expected batch action count to be larger than the number of documents in the set. + InitialBatchActionCount = numberOfDocuments + 1, + }); + + // Throw from every handler + int sent = 0, completed = 0; + indexer.ActionSent += e => + { + sent++; + + // Batch will be split at the 4th document. + // So, 3 documents will be sent before any are submitted, but 3 submissions will be made before the last 2 are sent + Assert.AreEqual((sent <= 3) ? 0 : 3, completed); + + throw new InvalidOperationException("ActionSentAsync: Should not be seen!"); + }; + + indexer.ActionCompleted += e => + { + completed++; + + // Batch will be split at the 4th document. + // So, 3 documents will be submitted after 3 are sent, and the last 2 submissions will be made after all 5 are sent + Assert.AreEqual((completed <= 3) ? 3 : 5, sent); + + throw new InvalidOperationException("ActionCompletedAsync: Should not be seen!"); + }; + + AssertNoFailures(indexer); + await indexer.UploadDocumentsAsync(data); + await indexer.FlushAsync(); + + Assert.AreEqual(5, sent); + Assert.AreEqual(5, completed); + } + [Test] [TestCase(409)] [TestCase(422)] diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json new file mode 100644 index 000000000000..035e6bea4756 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json @@ -0,0 +1,174 @@ +{ + "Entries": [ + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027pixdnnua\u0027)/docs/search.index?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=none", + "api-key": "Sanitized", + "Content-Length": "185", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "5ed99e6dc70249ab2e63c22de0a7d17e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "value": [ + { + "@search.action": "upload", + "Id": "0", + "Name": "Document #0" + }, + { + "@search.action": "upload", + "Id": "1", + "Name": "Document #1" + }, + { + "@search.action": "upload", + "Id": "2", + "Name": "Document #2" + } + ] + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "5ed99e6d-c702-49ab-2e63-c22de0a7d17e", + "Content-Length": "200", + "Content-Type": "application/json; odata.metadata=none", + "Date": "Fri, 05 Feb 2021 19:06:44 GMT", + "elapsed-time": "3163", + "Expires": "-1", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "5ed99e6d-c702-49ab-2e63-c22de0a7d17e", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "5ed99e6d-c702-49ab-2e63-c22de0a7d17e" + }, + "ResponseBody": { + "value": [ + { + "key": "0", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "1", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "2", + "status": true, + "errorMessage": null, + "statusCode": 201 + } + ] + } + }, + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027pixdnnua\u0027)/docs/search.index?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=none", + "api-key": "Sanitized", + "Content-Length": "127", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "05df6954fd5566874fc9d62df59f4884", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "value": [ + { + "@search.action": "upload", + "Id": "0", + "Name": "Document #3" + }, + { + "@search.action": "upload", + "Id": "4", + "Name": "Document #4" + } + ] + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "05df6954-fd55-6687-4fc9-d62df59f4884", + "Content-Length": "137", + "Content-Type": "application/json; odata.metadata=none", + "Date": "Fri, 05 Feb 2021 19:06:44 GMT", + "elapsed-time": "39", + "Expires": "-1", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "05df6954-fd55-6687-4fc9-d62df59f4884", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "05df6954-fd55-6687-4fc9-d62df59f4884" + }, + "ResponseBody": { + "value": [ + { + "key": "0", + "status": true, + "errorMessage": null, + "statusCode": 200 + }, + { + "key": "4", + "status": true, + "errorMessage": null, + "statusCode": 201 + } + ] + } + }, + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027pixdnnua\u0027)?api-version=2020-06-30", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "traceparent": "00-fe985dffea7ddf45adf5735279c06957-305fee8cbe695140-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "03885bcd80c76971665257993ff8f1d1", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "03885bcd-80c7-6971-6652-57993ff8f1d1", + "Date": "Fri, 05 Feb 2021 19:06:44 GMT", + "elapsed-time": "149", + "Expires": "-1", + "Pragma": "no-cache", + "request-id": "03885bcd-80c7-6971-6652-57993ff8f1d1", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "03885bcd-80c7-6971-6652-57993ff8f1d1" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1983456237", + "SearchIndexName": "pixdnnua", + "SEARCH_ADMIN_API_KEY": "Sanitized", + "SEARCH_SERVICE_NAME": "azs-net-mohitsearch" + } +} \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json new file mode 100644 index 000000000000..a24aad9791fe --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json @@ -0,0 +1,174 @@ +{ + "Entries": [ + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027rhrniqbm\u0027)/docs/search.index?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=none", + "api-key": "Sanitized", + "Content-Length": "185", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "6db692cb8d72f95232bce71033034505", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "value": [ + { + "@search.action": "upload", + "Id": "0", + "Name": "Document #0" + }, + { + "@search.action": "upload", + "Id": "1", + "Name": "Document #1" + }, + { + "@search.action": "upload", + "Id": "2", + "Name": "Document #2" + } + ] + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "6db692cb-8d72-f952-32bc-e71033034505", + "Content-Length": "200", + "Content-Type": "application/json; odata.metadata=none", + "Date": "Fri, 05 Feb 2021 19:07:07 GMT", + "elapsed-time": "106", + "Expires": "-1", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "6db692cb-8d72-f952-32bc-e71033034505", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "6db692cb-8d72-f952-32bc-e71033034505" + }, + "ResponseBody": { + "value": [ + { + "key": "0", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "1", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "2", + "status": true, + "errorMessage": null, + "statusCode": 201 + } + ] + } + }, + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027rhrniqbm\u0027)/docs/search.index?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=none", + "api-key": "Sanitized", + "Content-Length": "127", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ee7bd2d28a75ccd873eacbc6c74fb8af", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "value": [ + { + "@search.action": "upload", + "Id": "0", + "Name": "Document #3" + }, + { + "@search.action": "upload", + "Id": "4", + "Name": "Document #4" + } + ] + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "ee7bd2d2-8a75-ccd8-73ea-cbc6c74fb8af", + "Content-Length": "137", + "Content-Type": "application/json; odata.metadata=none", + "Date": "Fri, 05 Feb 2021 19:07:07 GMT", + "elapsed-time": "34", + "Expires": "-1", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "ee7bd2d2-8a75-ccd8-73ea-cbc6c74fb8af", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "ee7bd2d2-8a75-ccd8-73ea-cbc6c74fb8af" + }, + "ResponseBody": { + "value": [ + { + "key": "0", + "status": true, + "errorMessage": null, + "statusCode": 200 + }, + { + "key": "4", + "status": true, + "errorMessage": null, + "statusCode": 201 + } + ] + } + }, + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027rhrniqbm\u0027)?api-version=2020-06-30", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "traceparent": "00-d5db38d97945b34ea1968921d08d484b-d7c5cebfad155d4a-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "1ab7ceba4323b557fea50d80b5364cd4", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "1ab7ceba-4323-b557-fea5-0d80b5364cd4", + "Date": "Fri, 05 Feb 2021 19:07:07 GMT", + "elapsed-time": "132", + "Expires": "-1", + "Pragma": "no-cache", + "request-id": "1ab7ceba-4323-b557-fea5-0d80b5364cd4", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "1ab7ceba-4323-b557-fea5-0d80b5364cd4" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "852335928", + "SearchIndexName": "rhrniqbm", + "SEARCH_ADMIN_API_KEY": "Sanitized", + "SEARCH_SERVICE_NAME": "azs-net-mohitsearch" + } +} \ No newline at end of file From faed37e9fba9d78411db66fa4fb68d3f54aab1e4 Mon Sep 17 00:00:00 2001 From: Mohit Chakraborty Date: Fri, 5 Feb 2021 14:57:21 -0800 Subject: [PATCH 3/3] Add a test to verify case-sensitive nature of keys --- .../tests/Batching/BatchingTests.cs | 58 ++++++++ .../Behavior_SplitBatchByDocumentKey.json | 54 +++---- ...Behavior_SplitBatchByDocumentKeyAsync.json | 54 +++---- ...tchByDocumentKeyIgnoreCaseDifferences.json | 134 ++++++++++++++++++ ...DocumentKeyIgnoreCaseDifferencesAsync.json | 134 ++++++++++++++++++ 5 files changed, 380 insertions(+), 54 deletions(-) create mode 100644 sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferences.json create mode 100644 sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferencesAsync.json diff --git a/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs b/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs index 74855ae4a79d..7ca17cbec6d1 100644 --- a/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs +++ b/sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs @@ -1090,6 +1090,64 @@ public async Task Behavior_SplitBatchByDocumentKey() Assert.AreEqual(5, completed); } + [Test] + public async Task Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferences() + { + int numberOfDocuments = 5; + + await using SearchResources resources = await SearchResources.CreateWithEmptyIndexAsync(this); + BatchingSearchClient client = GetBatchingSearchClient(resources); + + // 'SimpleDocument' has 'Id' set as its key field. + // Set the Ids of 2 documents in the group to differ only in case from another 2. + // We expect the batch to NOT be split because keys are case-sensitive and the publisher should consider them all unique. + SimpleDocument[] data = new SimpleDocument[] + { + new SimpleDocument() { Id = "a", Name = "Document a" }, + new SimpleDocument() { Id = "b", Name = "Document b" }, + new SimpleDocument() { Id = "c", Name = "Document c" }, + new SimpleDocument() { Id = "A", Name = "Document A" }, + new SimpleDocument() { Id = "B", Name = "Document B" }, + }; + + await using SearchIndexingBufferedSender indexer = + client.CreateIndexingBufferedSender( + new SearchIndexingBufferedSenderOptions() + { + // Make sure the expected batch action is larger than the number of documents in the set. + InitialBatchActionCount = numberOfDocuments + 1, + }); + + // Throw from every handler + int sent = 0, completed = 0; + indexer.ActionSent += e => + { + sent++; + + // Batch will not be split. So, no document will be submitted before all are sent. + Assert.AreEqual(0, completed); + + throw new InvalidOperationException("ActionSentAsync: Should not be seen!"); + }; + + indexer.ActionCompleted += e => + { + completed++; + + // Batch will not be split. So, all documents will be sent before any are submitted. + Assert.AreEqual(5, sent); + + throw new InvalidOperationException("ActionCompletedAsync: Should not be seen!"); + }; + + AssertNoFailures(indexer); + await indexer.UploadDocumentsAsync(data); + await indexer.FlushAsync(); + + Assert.AreEqual(5, sent); + Assert.AreEqual(5, completed); + } + [Test] [TestCase(409)] [TestCase(422)] diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json index 035e6bea4756..ab73bfeaa705 100644 --- a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKey.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027pixdnnua\u0027)/docs/search.index?api-version=2020-06-30", + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027hrincacx\u0027)/docs/search.index?api-version=2020-06-30", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json; odata.metadata=none", @@ -10,9 +10,9 @@ "Content-Type": "application/json", "User-Agent": [ "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" ], - "x-ms-client-request-id": "5ed99e6dc70249ab2e63c22de0a7d17e", + "x-ms-client-request-id": "d4be9db11864e8d6e1d0d66c397968d1", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -37,18 +37,18 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "5ed99e6d-c702-49ab-2e63-c22de0a7d17e", + "client-request-id": "d4be9db1-1864-e8d6-e1d0-d66c397968d1", "Content-Length": "200", "Content-Type": "application/json; odata.metadata=none", - "Date": "Fri, 05 Feb 2021 19:06:44 GMT", - "elapsed-time": "3163", + "Date": "Fri, 05 Feb 2021 22:44:28 GMT", + "elapsed-time": "144", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", "Preference-Applied": "odata.include-annotations=\u0022*\u0022", - "request-id": "5ed99e6d-c702-49ab-2e63-c22de0a7d17e", + "request-id": "d4be9db1-1864-e8d6-e1d0-d66c397968d1", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "5ed99e6d-c702-49ab-2e63-c22de0a7d17e" + "x-ms-client-request-id": "d4be9db1-1864-e8d6-e1d0-d66c397968d1" }, "ResponseBody": { "value": [ @@ -74,7 +74,7 @@ } }, { - "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027pixdnnua\u0027)/docs/search.index?api-version=2020-06-30", + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027hrincacx\u0027)/docs/search.index?api-version=2020-06-30", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json; odata.metadata=none", @@ -83,9 +83,9 @@ "Content-Type": "application/json", "User-Agent": [ "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" ], - "x-ms-client-request-id": "05df6954fd5566874fc9d62df59f4884", + "x-ms-client-request-id": "799e43a8ca4eba733a805d451724b2f5", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -105,18 +105,18 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "05df6954-fd55-6687-4fc9-d62df59f4884", + "client-request-id": "799e43a8-ca4e-ba73-3a80-5d451724b2f5", "Content-Length": "137", "Content-Type": "application/json; odata.metadata=none", - "Date": "Fri, 05 Feb 2021 19:06:44 GMT", - "elapsed-time": "39", + "Date": "Fri, 05 Feb 2021 22:44:28 GMT", + "elapsed-time": "44", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", "Preference-Applied": "odata.include-annotations=\u0022*\u0022", - "request-id": "05df6954-fd55-6687-4fc9-d62df59f4884", + "request-id": "799e43a8-ca4e-ba73-3a80-5d451724b2f5", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "05df6954-fd55-6687-4fc9-d62df59f4884" + "x-ms-client-request-id": "799e43a8-ca4e-ba73-3a80-5d451724b2f5" }, "ResponseBody": { "value": [ @@ -136,38 +136,38 @@ } }, { - "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027pixdnnua\u0027)?api-version=2020-06-30", + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027hrincacx\u0027)?api-version=2020-06-30", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json; odata.metadata=minimal", "api-key": "Sanitized", - "traceparent": "00-fe985dffea7ddf45adf5735279c06957-305fee8cbe695140-00", + "traceparent": "00-efc7cdf91216d94782770f05f4b7a079-1304099684540b45-00", "User-Agent": [ "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" ], - "x-ms-client-request-id": "03885bcd80c76971665257993ff8f1d1", + "x-ms-client-request-id": "307ac7aee0220e3a2c12cb8fca6fa0e0", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "03885bcd-80c7-6971-6652-57993ff8f1d1", - "Date": "Fri, 05 Feb 2021 19:06:44 GMT", - "elapsed-time": "149", + "client-request-id": "307ac7ae-e022-0e3a-2c12-cb8fca6fa0e0", + "Date": "Fri, 05 Feb 2021 22:44:28 GMT", + "elapsed-time": "161", "Expires": "-1", "Pragma": "no-cache", - "request-id": "03885bcd-80c7-6971-6652-57993ff8f1d1", + "request-id": "307ac7ae-e022-0e3a-2c12-cb8fca6fa0e0", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "03885bcd-80c7-6971-6652-57993ff8f1d1" + "x-ms-client-request-id": "307ac7ae-e022-0e3a-2c12-cb8fca6fa0e0" }, "ResponseBody": [] } ], "Variables": { - "RandomSeed": "1983456237", - "SearchIndexName": "pixdnnua", + "RandomSeed": "1504326134", + "SearchIndexName": "hrincacx", "SEARCH_ADMIN_API_KEY": "Sanitized", "SEARCH_SERVICE_NAME": "azs-net-mohitsearch" } diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json index a24aad9791fe..ecdcea7bba87 100644 --- a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyAsync.json @@ -1,7 +1,7 @@ { "Entries": [ { - "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027rhrniqbm\u0027)/docs/search.index?api-version=2020-06-30", + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027logumxsd\u0027)/docs/search.index?api-version=2020-06-30", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json; odata.metadata=none", @@ -10,9 +10,9 @@ "Content-Type": "application/json", "User-Agent": [ "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" ], - "x-ms-client-request-id": "6db692cb8d72f95232bce71033034505", + "x-ms-client-request-id": "56273ea36ef0b1f89687ef32e22b75f2", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -37,18 +37,18 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "6db692cb-8d72-f952-32bc-e71033034505", + "client-request-id": "56273ea3-6ef0-b1f8-9687-ef32e22b75f2", "Content-Length": "200", "Content-Type": "application/json; odata.metadata=none", - "Date": "Fri, 05 Feb 2021 19:07:07 GMT", - "elapsed-time": "106", + "Date": "Fri, 05 Feb 2021 22:45:48 GMT", + "elapsed-time": "149", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", "Preference-Applied": "odata.include-annotations=\u0022*\u0022", - "request-id": "6db692cb-8d72-f952-32bc-e71033034505", + "request-id": "56273ea3-6ef0-b1f8-9687-ef32e22b75f2", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "6db692cb-8d72-f952-32bc-e71033034505" + "x-ms-client-request-id": "56273ea3-6ef0-b1f8-9687-ef32e22b75f2" }, "ResponseBody": { "value": [ @@ -74,7 +74,7 @@ } }, { - "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027rhrniqbm\u0027)/docs/search.index?api-version=2020-06-30", + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027logumxsd\u0027)/docs/search.index?api-version=2020-06-30", "RequestMethod": "POST", "RequestHeaders": { "Accept": "application/json; odata.metadata=none", @@ -83,9 +83,9 @@ "Content-Type": "application/json", "User-Agent": [ "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" ], - "x-ms-client-request-id": "ee7bd2d28a75ccd873eacbc6c74fb8af", + "x-ms-client-request-id": "b7e8bda3875e4dee76d92fdfbca385b9", "x-ms-return-client-request-id": "true" }, "RequestBody": { @@ -105,18 +105,18 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "ee7bd2d2-8a75-ccd8-73ea-cbc6c74fb8af", + "client-request-id": "b7e8bda3-875e-4dee-76d9-2fdfbca385b9", "Content-Length": "137", "Content-Type": "application/json; odata.metadata=none", - "Date": "Fri, 05 Feb 2021 19:07:07 GMT", - "elapsed-time": "34", + "Date": "Fri, 05 Feb 2021 22:45:48 GMT", + "elapsed-time": "35", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", "Preference-Applied": "odata.include-annotations=\u0022*\u0022", - "request-id": "ee7bd2d2-8a75-ccd8-73ea-cbc6c74fb8af", + "request-id": "b7e8bda3-875e-4dee-76d9-2fdfbca385b9", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "ee7bd2d2-8a75-ccd8-73ea-cbc6c74fb8af" + "x-ms-client-request-id": "b7e8bda3-875e-4dee-76d9-2fdfbca385b9" }, "ResponseBody": { "value": [ @@ -136,38 +136,38 @@ } }, { - "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027rhrniqbm\u0027)?api-version=2020-06-30", + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027logumxsd\u0027)?api-version=2020-06-30", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json; odata.metadata=minimal", "api-key": "Sanitized", - "traceparent": "00-d5db38d97945b34ea1968921d08d484b-d7c5cebfad155d4a-00", + "traceparent": "00-4c1da991c4643f4f8316eb88c41b240f-1643328e658eb44f-00", "User-Agent": [ "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", - "(.NET Core 4.6.29518.01; Microsoft Windows 10.0.19042 )" + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" ], - "x-ms-client-request-id": "1ab7ceba4323b557fea50d80b5364cd4", + "x-ms-client-request-id": "d5b516f99c255fbed8b014a2a28a33d0", "x-ms-return-client-request-id": "true" }, "RequestBody": null, "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "client-request-id": "1ab7ceba-4323-b557-fea5-0d80b5364cd4", - "Date": "Fri, 05 Feb 2021 19:07:07 GMT", - "elapsed-time": "132", + "client-request-id": "d5b516f9-9c25-5fbe-d8b0-14a2a28a33d0", + "Date": "Fri, 05 Feb 2021 22:45:48 GMT", + "elapsed-time": "159", "Expires": "-1", "Pragma": "no-cache", - "request-id": "1ab7ceba-4323-b557-fea5-0d80b5364cd4", + "request-id": "d5b516f9-9c25-5fbe-d8b0-14a2a28a33d0", "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "x-ms-client-request-id": "1ab7ceba-4323-b557-fea5-0d80b5364cd4" + "x-ms-client-request-id": "d5b516f9-9c25-5fbe-d8b0-14a2a28a33d0" }, "ResponseBody": [] } ], "Variables": { - "RandomSeed": "852335928", - "SearchIndexName": "rhrniqbm", + "RandomSeed": "1438815808", + "SearchIndexName": "logumxsd", "SEARCH_ADMIN_API_KEY": "Sanitized", "SEARCH_SERVICE_NAME": "azs-net-mohitsearch" } diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferences.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferences.json new file mode 100644 index 000000000000..bbe8012f460a --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferences.json @@ -0,0 +1,134 @@ +{ + "Entries": [ + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027tvaeqdfl\u0027)/docs/search.index?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=none", + "api-key": "Sanitized", + "Content-Length": "296", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "fe249da6c3cdf22c3c6fd9e36c76447d", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "value": [ + { + "@search.action": "upload", + "Id": "a", + "Name": "Document a" + }, + { + "@search.action": "upload", + "Id": "b", + "Name": "Document b" + }, + { + "@search.action": "upload", + "Id": "c", + "Name": "Document c" + }, + { + "@search.action": "upload", + "Id": "A", + "Name": "Document A" + }, + { + "@search.action": "upload", + "Id": "B", + "Name": "Document B" + } + ] + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "fe249da6-c3cd-f22c-3c6f-d9e36c76447d", + "Content-Length": "326", + "Content-Type": "application/json; odata.metadata=none", + "Date": "Fri, 05 Feb 2021 22:44:51 GMT", + "elapsed-time": "136", + "Expires": "-1", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "fe249da6-c3cd-f22c-3c6f-d9e36c76447d", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "fe249da6-c3cd-f22c-3c6f-d9e36c76447d" + }, + "ResponseBody": { + "value": [ + { + "key": "a", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "b", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "c", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "A", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "B", + "status": true, + "errorMessage": null, + "statusCode": 201 + } + ] + } + }, + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027tvaeqdfl\u0027)?api-version=2020-06-30", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "traceparent": "00-ff6276b7ce31e14289ea34074d9bed8f-6296353d0a9b7a44-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "d021c9ed43f0373c91ab9cfc82caea9e", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "d021c9ed-43f0-373c-91ab-9cfc82caea9e", + "Date": "Fri, 05 Feb 2021 22:44:51 GMT", + "elapsed-time": "160", + "Expires": "-1", + "Pragma": "no-cache", + "request-id": "d021c9ed-43f0-373c-91ab-9cfc82caea9e", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "d021c9ed-43f0-373c-91ab-9cfc82caea9e" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "2144378735", + "SearchIndexName": "tvaeqdfl", + "SEARCH_ADMIN_API_KEY": "Sanitized", + "SEARCH_SERVICE_NAME": "azs-net-mohitsearch" + } +} \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferencesAsync.json b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferencesAsync.json new file mode 100644 index 000000000000..b5b9e7bc78d5 --- /dev/null +++ b/sdk/search/Azure.Search.Documents/tests/SessionRecords/BatchingTests/Behavior_SplitBatchByDocumentKeyIgnoreCaseDifferencesAsync.json @@ -0,0 +1,134 @@ +{ + "Entries": [ + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027wdhwmfxg\u0027)/docs/search.index?api-version=2020-06-30", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=none", + "api-key": "Sanitized", + "Content-Length": "296", + "Content-Type": "application/json", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "065b126c86d7642d03ca017259712b85", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": { + "value": [ + { + "@search.action": "upload", + "Id": "a", + "Name": "Document a" + }, + { + "@search.action": "upload", + "Id": "b", + "Name": "Document b" + }, + { + "@search.action": "upload", + "Id": "c", + "Name": "Document c" + }, + { + "@search.action": "upload", + "Id": "A", + "Name": "Document A" + }, + { + "@search.action": "upload", + "Id": "B", + "Name": "Document B" + } + ] + }, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "065b126c-86d7-642d-03ca-017259712b85", + "Content-Length": "326", + "Content-Type": "application/json; odata.metadata=none", + "Date": "Fri, 05 Feb 2021 22:46:11 GMT", + "elapsed-time": "157", + "Expires": "-1", + "OData-Version": "4.0", + "Pragma": "no-cache", + "Preference-Applied": "odata.include-annotations=\u0022*\u0022", + "request-id": "065b126c-86d7-642d-03ca-017259712b85", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "065b126c-86d7-642d-03ca-017259712b85" + }, + "ResponseBody": { + "value": [ + { + "key": "a", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "b", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "c", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "A", + "status": true, + "errorMessage": null, + "statusCode": 201 + }, + { + "key": "B", + "status": true, + "errorMessage": null, + "statusCode": 201 + } + ] + } + }, + { + "RequestUri": "https://azs-net-mohitsearch.search.windows.net/indexes(\u0027wdhwmfxg\u0027)?api-version=2020-06-30", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Accept": "application/json; odata.metadata=minimal", + "api-key": "Sanitized", + "traceparent": "00-c98e5c15d7dc4d4ca855ddbae4d3d97c-d273ade3062b944e-00", + "User-Agent": [ + "azsdk-net-Search.Documents/11.2.0-alpha.20210205.1", + "(.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "25c89562ca5ac0e402c746bc8264ffa9", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "client-request-id": "25c89562-ca5a-c0e4-02c7-46bc8264ffa9", + "Date": "Fri, 05 Feb 2021 22:46:11 GMT", + "elapsed-time": "126", + "Expires": "-1", + "Pragma": "no-cache", + "request-id": "25c89562-ca5a-c0e4-02c7-46bc8264ffa9", + "Strict-Transport-Security": "max-age=15724800; includeSubDomains", + "x-ms-client-request-id": "25c89562-ca5a-c0e4-02c7-46bc8264ffa9" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1854075059", + "SearchIndexName": "wdhwmfxg", + "SEARCH_ADMIN_API_KEY": "Sanitized", + "SEARCH_SERVICE_NAME": "azs-net-mohitsearch" + } +} \ No newline at end of file