diff --git a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/models/Author.java b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/models/Author.java new file mode 100644 index 0000000000000..d9da40d7cbc79 --- /dev/null +++ b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/models/Author.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.search.data.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +public class Author { + @JsonProperty(value = "FirstName") + private String firstName; + + @JsonProperty(value = "LastName") + private String lastName; + + public String firstName() { + return this.firstName; + } + + public Author firstName(String firstName) { + this.firstName = firstName; + return this; + } + + public String lastName() { + return this.lastName; + } + + public Author lastName(String lastName) { + this.lastName = lastName; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Author)) return false; + Author author = (Author) o; + return Objects.equals(firstName, author.firstName) && + Objects.equals(lastName, author.lastName); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName); + } +} diff --git a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/models/Book.java b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/models/Book.java new file mode 100644 index 0000000000000..bf46d51c927b5 --- /dev/null +++ b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/models/Book.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.search.data.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Date; +import java.util.Objects; + +public class Book { + @JsonProperty(value = "ISBN") + private String ISBN; + + @JsonProperty(value = "Title") + private String title; + + @JsonProperty(value = "Author") + private Author author; + + @JsonProperty(value = "PublishDate") + private Date publishDate; + + public String ISBN() { + return this.ISBN; + } + + public Book ISBN(String ISBN) { + this.ISBN = ISBN; + return this; + } + + public String title() { + return this.title; + } + + public Book title(String title) { + this.title = title; + return this; + } + + public Author author() { + return this.author; + } + + public Book author(Author author) { + this.author = author; + return this; + } + + public Date publishDate() { + return this.publishDate; + } + + public Book publishDate(Date publishDate) { + this.publishDate = publishDate; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Book)) return false; + Book book = (Book) o; + return Objects.equals(ISBN, book.ISBN) && + Objects.equals(title, book.title) && + Objects.equals(author, book.author) && + Objects.equals(publishDate, book.publishDate); + } + + @Override + public int hashCode() { + return Objects.hash(ISBN, title, author, publishDate); + } +} diff --git a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingAsyncTests.java b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingAsyncTests.java index ec4173b8eb5ab..a0fa4187c00b3 100644 --- a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingAsyncTests.java +++ b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingAsyncTests.java @@ -12,11 +12,22 @@ import com.azure.search.data.generated.models.IndexAction; import com.azure.search.data.generated.models.IndexActionType; import com.azure.search.data.generated.models.IndexBatch; +import com.azure.search.data.models.Book; +import com.azure.search.service.models.Index; +import com.fasterxml.jackson.databind.ObjectMapper; import com.azure.search.data.models.Hotel; import io.netty.handler.codec.http.HttpResponseStatus; +import org.junit.Assert; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -81,6 +92,92 @@ public void canRoundtripBoundaryValues() throws Exception { } } + @Override + public void dynamicDocumentDateTimesRoundTripAsUtc() throws IOException { + // Book 1's publish date is in UTC format, and book 2's is unspecified. + List> books = Arrays.asList( + new HashMap() { + { + put(ISBN_FIELD, ISBN1); + put(PUBLISH_DATE_FIELD, DATE_UTC); + } + }, + new HashMap() { + { + put(ISBN_FIELD, ISBN2); + put(PUBLISH_DATE_FIELD, "2010-06-27T00:00:00-00:00"); + } + } + ); + + // Create 'books' index + Reader indexData = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(BOOKS_INDEX_JSON)); + Index index = new ObjectMapper().readValue(indexData, Index.class); + if (!interceptorManager.isPlaybackMode()) { + searchServiceClient.indexes().create(index); + } + + // Upload and retrieve book documents + uploadDocuments(client, BOOKS_INDEX_NAME, books); + Mono actualBook1 = client.getDocument(ISBN1); + Mono actualBook2 = client.getDocument(ISBN2); + + // Verify + StepVerifier + .create(actualBook1) + .assertNext(res -> { + Assert.assertEquals(DATE_UTC, res.get(PUBLISH_DATE_FIELD)); + }) + .verifyComplete(); + StepVerifier + .create(actualBook2) + .assertNext(res -> { + Assert.assertEquals(DATE_UTC, res.get(PUBLISH_DATE_FIELD)); + }) + .verifyComplete(); + } + + @Override + public void staticallyTypedDateTimesRoundTripAsUtc() throws Exception { + // Book 1's publish date is in UTC format, and book 2's is unspecified. + DateFormat dateFormatUtc = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + DateFormat dateFormatUnspecifiedTimezone = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List books = Arrays.asList( + new Book() + .ISBN(ISBN1) + .publishDate(dateFormatUtc.parse(DATE_UTC)), + new Book() + .ISBN(ISBN2) + .publishDate(dateFormatUnspecifiedTimezone.parse("2010-06-27 00:00:00")) + ); + + // Create 'books' index + Reader indexData = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(BOOKS_INDEX_JSON)); + Index index = new ObjectMapper().readValue(indexData, Index.class); + if (!interceptorManager.isPlaybackMode()) { + searchServiceClient.indexes().create(index); + } + + // Upload and retrieve book documents + uploadDocuments(client, BOOKS_INDEX_NAME, books); + Mono actualBook1 = client.getDocument(ISBN1); + Mono actualBook2 = client.getDocument(ISBN2); + + // Verify + StepVerifier + .create(actualBook1) + .assertNext(res -> { + Assert.assertEquals(books.get(0).publishDate(), res.as(Book.class).publishDate()); + }) + .verifyComplete(); + StepVerifier + .create(actualBook2) + .assertNext(res -> { + Assert.assertEquals(books.get(1).publishDate(), res.as(Book.class).publishDate()); + }) + .verifyComplete(); + } + @Override protected void initializeClient() { client = builderSetup().indexName(INDEX_NAME).buildAsyncClient(); diff --git a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingSyncTests.java b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingSyncTests.java index 76ce6005a8c27..c1bbe85b8f055 100644 --- a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingSyncTests.java +++ b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingSyncTests.java @@ -11,11 +11,20 @@ import com.azure.search.data.generated.models.IndexAction; import com.azure.search.data.generated.models.IndexActionType; import com.azure.search.data.generated.models.IndexBatch; +import com.azure.search.data.models.Book; +import com.azure.search.service.models.Index; +import com.fasterxml.jackson.databind.ObjectMapper; import com.azure.search.data.models.Hotel; import org.junit.Assert; import org.junit.Rule; import org.junit.rules.ExpectedException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -72,6 +81,72 @@ public void canRoundtripBoundaryValues() throws Exception { } } + @Override + public void dynamicDocumentDateTimesRoundTripAsUtc() throws Exception { + // Book 1's publish date is in UTC format, and book 2's is unspecified. + List> books = Arrays.asList( + new HashMap() { + { + put(ISBN_FIELD, ISBN1); + put(PUBLISH_DATE_FIELD, DATE_UTC); + } + }, + new HashMap() { + { + put(ISBN_FIELD, ISBN2); + put(PUBLISH_DATE_FIELD, "2010-06-27T00:00:00-00:00"); + } + } + ); + + // Create 'books' index + Reader indexData = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(BOOKS_INDEX_JSON)); + Index index = new ObjectMapper().readValue(indexData, Index.class); + if (!interceptorManager.isPlaybackMode()) { + searchServiceClient.indexes().create(index); + } + + // Upload and retrieve book documents + uploadDocuments(client, BOOKS_INDEX_NAME, books); + Document actualBook1 = client.getDocument(ISBN1); + Document actualBook2 = client.getDocument(ISBN2); + + // Verify + Assert.assertEquals(DATE_UTC, actualBook1.get(PUBLISH_DATE_FIELD)); + Assert.assertEquals(DATE_UTC, actualBook2.get(PUBLISH_DATE_FIELD)); + } + + @Override + public void staticallyTypedDateTimesRoundTripAsUtc() throws Exception { + // Book 1's publish date is in UTC format, and book 2's is unspecified. + DateFormat dateFormatUtc = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); + DateFormat dateFormatUnspecifiedTimezone = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + List books = Arrays.asList( + new Book() + .ISBN(ISBN1) + .publishDate(dateFormatUtc.parse(DATE_UTC)), + new Book() + .ISBN(ISBN2) + .publishDate(dateFormatUnspecifiedTimezone.parse("2010-06-27 00:00:00")) + ); + + // Create 'books' index + Reader indexData = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(BOOKS_INDEX_JSON)); + Index index = new ObjectMapper().readValue(indexData, Index.class); + if (!interceptorManager.isPlaybackMode()) { + searchServiceClient.indexes().create(index); + } + + // Upload and retrieve book documents + uploadDocuments(client, BOOKS_INDEX_NAME, books); + Document actualBook1 = client.getDocument(ISBN1); + Document actualBook2 = client.getDocument(ISBN2); + + // Verify + Assert.assertEquals(books.get(0).publishDate(), actualBook1.as(Book.class).publishDate()); + Assert.assertEquals(books.get(1).publishDate(), actualBook2.as(Book.class).publishDate()); + } + @Override protected void initializeClient() { client = builderSetup().indexName(INDEX_NAME).buildClient(); diff --git a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingTestBase.java b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingTestBase.java index c30794483b67e..d6bead6abd7b6 100644 --- a/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingTestBase.java +++ b/sdk/search/azure-search-data/src/test/java/com/azure/search/data/tests/IndexingTestBase.java @@ -6,6 +6,9 @@ import com.azure.search.data.env.SearchIndexClientTestBase; import com.azure.search.data.generated.models.IndexAction; import com.azure.search.data.generated.models.IndexActionType; +import com.azure.search.service.SearchServiceClient; +import com.azure.search.service.customization.SearchCredentials; +import com.azure.search.service.implementation.SearchServiceClientImpl; import com.azure.search.data.models.Hotel; import com.azure.search.data.models.HotelAddress; import com.azure.search.data.models.HotelRoom; @@ -18,11 +21,25 @@ public abstract class IndexingTestBase extends SearchIndexClientTestBase { protected static final String INDEX_NAME = "hotels"; + protected static final String BOOKS_INDEX_NAME = "books"; + protected static final String BOOKS_INDEX_JSON = "BooksIndexData.json"; + protected static final String PUBLISH_DATE_FIELD = "PublishDate"; + protected static final String ISBN_FIELD = "ISBN"; + protected static final String ISBN1 = "1"; + protected static final String ISBN2 = "2"; + protected static final String DATE_UTC = "2010-06-27T00:00:00Z"; + protected SearchServiceClient searchServiceClient; @Override protected void beforeTest() { super.beforeTest(); initializeClient(); + + if (searchServiceClient == null) { + SearchCredentials searchCredentials = new SearchCredentials(apiKey); + searchServiceClient = new SearchServiceClientImpl(searchCredentials) + .withSearchServiceName(searchServiceName); + } } @Test @@ -34,6 +51,12 @@ protected void beforeTest() { @Test public abstract void canRoundtripBoundaryValues() throws Exception; + @Test + public abstract void dynamicDocumentDateTimesRoundTripAsUtc() throws Exception; + + @Test + public abstract void staticallyTypedDateTimesRoundTripAsUtc() throws Exception; + protected abstract void initializeClient(); protected void addDocumentToIndexActions(List indexActions, IndexActionType indexActionType, HashMap document) { @@ -55,9 +78,9 @@ protected List getBoundaryValues() throws ParseException { .tags(Arrays.asList()) .address(new HotelAddress()) .rooms(Arrays.asList( - new HotelRoom() - .baseRate(Double.MIN_VALUE) - )), + new HotelRoom() + .baseRate(Double.MIN_VALUE) + )), // Maximimum values new Hotel() .hotelId("2") @@ -70,9 +93,9 @@ protected List getBoundaryValues() throws ParseException { .address(new HotelAddress() .city("Maximum")) .rooms(Arrays.asList( - new HotelRoom() - .baseRate(Double.MAX_VALUE) - )), + new HotelRoom() + .baseRate(Double.MAX_VALUE) + )), // Other boundary values #1 new Hotel() .hotelId("3") @@ -85,26 +108,26 @@ protected List getBoundaryValues() throws ParseException { .address(new HotelAddress() .city("Maximum")) .rooms(Arrays.asList( - new HotelRoom() - .baseRate(Double.NEGATIVE_INFINITY) - )), + new HotelRoom() + .baseRate(Double.NEGATIVE_INFINITY) + )), // Other boundary values #2 new Hotel() .hotelId("4") .location(null) .tags(Arrays.asList()) .rooms(Arrays.asList( - new HotelRoom() - .baseRate(Double.POSITIVE_INFINITY) - )), + new HotelRoom() + .baseRate(Double.POSITIVE_INFINITY) + )), // Other boundary values #3 new Hotel() .hotelId("5") .tags(Arrays.asList()) .rooms(Arrays.asList( - new HotelRoom() - .baseRate(Double.NaN) - )), + new HotelRoom() + .baseRate(Double.NaN) + )), // Other boundary values #4 new Hotel() .hotelId("6") diff --git a/sdk/search/azure-search-data/src/test/resources/BooksIndexData.json b/sdk/search/azure-search-data/src/test/resources/BooksIndexData.json new file mode 100644 index 0000000000000..826d9a7e274e3 --- /dev/null +++ b/sdk/search/azure-search-data/src/test/resources/BooksIndexData.json @@ -0,0 +1,33 @@ +{ + "name": "books", + "fields": [ + { + "name": "ISBN", + "type": "Edm.String", + "key": true + }, + { + "name": "Title", + "type": "Edm.String", + "searchable": true + }, + { + "name": "Author", + "type": "Edm.ComplexType", + "fields": [ + { + "name": "FirstName", + "type": "Edm.String" + }, + { + "name": "LastName", + "type": "Edm.String" + } + ] + }, + { + "name": "PublishDate", + "type": "Edm.DateTimeOffset" + } + ] +} diff --git a/sdk/search/azure-search-data/target/test-classes/session-records/canRoundtripBoundaryValues.json b/sdk/search/azure-search-data/src/test/resources/session-records/canRoundtripBoundaryValues.json similarity index 76% rename from sdk/search/azure-search-data/target/test-classes/session-records/canRoundtripBoundaryValues.json rename to sdk/search/azure-search-data/src/test/resources/session-records/canRoundtripBoundaryValues.json index 8ce631a20ba43..33679ad780d76 100644 --- a/sdk/search/azure-search-data/target/test-classes/session-records/canRoundtripBoundaryValues.json +++ b/sdk/search/azure-search-data/src/test/resources/session-records/canRoundtripBoundaryValues.json @@ -1,146 +1,146 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs/search.index?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs/search.index?api-version=2019-05-06", "Headers" : { "Content-Type" : "application/json; charset=utf-8" }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "b2fbb142-6229-4107-9aee-10c927723414", + "request-id" : "bd733691-da4a-4cfd-b37e-9a61b88e6b65", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:36 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:36 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "740", + "elapsed-time" : "436", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "542", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#Collection(Microsoft.Azure.Search.V2019_05_06.IndexResult)\",\"value\":[{\"key\":\"1\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"2\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"3\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"4\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"5\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"6\",\"status\":true,\"errorMessage\":null,\"statusCode\":201}]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#Collection(Microsoft.Azure.Search.V2019_05_06.IndexResult)\",\"value\":[{\"key\":\"1\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"2\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"3\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"4\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"5\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"6\",\"status\":true,\"errorMessage\":null,\"statusCode\":201}]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } }, { "Method" : "GET", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs('1')?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs('1')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "ac2270e3-05b3-452c-9d63-8ff13b685301", + "request-id" : "fab32f1c-38ea-4c81-99a8-5d6cb43e4bbb", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:38 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "125", + "elapsed-time" : "17", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "697", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"1\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":\"\",\"Tags\":[],\"ParkingIncluded\":false,\"SmokingAllowed\":null,\"LastRenovationDate\":\"0001-01-01T00:00:00Z\",\"Rating\":-2147483648,\"Location\":{\"type\":\"Point\",\"coordinates\":[-180.0,-90.0],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}},\"Address\":{\"StreetAddress\":null,\"City\":null,\"StateProvince\":null,\"PostalCode\":null,\"Country\":null},\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":4.94065645841247E-324,\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"1\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":\"\",\"Tags\":[],\"ParkingIncluded\":false,\"SmokingAllowed\":null,\"LastRenovationDate\":\"0001-01-01T00:00:00Z\",\"Rating\":-2147483648,\"Location\":{\"type\":\"Point\",\"coordinates\":[-180.0,-90.0],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}},\"Address\":{\"StreetAddress\":null,\"City\":null,\"StateProvince\":null,\"PostalCode\":null,\"Country\":null},\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":4.94065645841247E-324,\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } }, { "Method" : "GET", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs('2')?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs('2')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "a706fa6a-1e9e-41b9-8935-89502b8d819c", + "request-id" : "4381e780-9734-43e5-952f-9e38ec94271f", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:38 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "37", + "elapsed-time" : "7", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "710", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"2\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":\"test\",\"Tags\":[\"test\"],\"ParkingIncluded\":true,\"SmokingAllowed\":null,\"LastRenovationDate\":\"9999-12-31T11:59:59Z\",\"Rating\":2147483647,\"Location\":{\"type\":\"Point\",\"coordinates\":[180.0,90.0],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}},\"Address\":{\"StreetAddress\":null,\"City\":\"Maximum\",\"StateProvince\":null,\"PostalCode\":null,\"Country\":null},\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":1.7976931348623157E+308,\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"2\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":\"test\",\"Tags\":[\"test\"],\"ParkingIncluded\":true,\"SmokingAllowed\":null,\"LastRenovationDate\":\"9999-12-31T11:59:59Z\",\"Rating\":2147483647,\"Location\":{\"type\":\"Point\",\"coordinates\":[180.0,90.0],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}},\"Address\":{\"StreetAddress\":null,\"City\":\"Maximum\",\"StateProvince\":null,\"PostalCode\":null,\"Country\":null},\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":1.7976931348623157E+308,\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } }, { "Method" : "GET", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs('3')?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs('3')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "66822be4-1545-4517-a9ca-9f83a5b83e07", + "request-id" : "015f051c-d0f2-4ea0-9a35-cae896fdc71c", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:38 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "7", + "elapsed-time" : "11", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "658", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"3\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":{\"type\":\"Point\",\"coordinates\":[0.0,0.0],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}},\"Address\":{\"StreetAddress\":null,\"City\":\"Maximum\",\"StateProvince\":null,\"PostalCode\":null,\"Country\":null},\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":\"-INF\",\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"3\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":{\"type\":\"Point\",\"coordinates\":[0.0,0.0],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:4326\"}}},\"Address\":{\"StreetAddress\":null,\"City\":\"Maximum\",\"StateProvince\":null,\"PostalCode\":null,\"Country\":null},\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":\"-INF\",\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } }, { "Method" : "GET", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs('4')?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs('4')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "162ffcd0-d85c-4eb5-b5a2-c1d8f0466f2d", + "request-id" : "17059afb-f8f1-4130-8078-cea9e2ba755e", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:38 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "15", + "elapsed-time" : "7", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "476", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"4\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":null,\"Address\":null,\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":\"INF\",\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"4\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":null,\"Address\":null,\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":\"INF\",\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } }, { "Method" : "GET", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs('5')?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs('5')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "a274a935-4a80-48f2-8ed1-f37106ac93b0", + "request-id" : "8563e23d-1936-4f03-9a2a-30d780b0459b", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:38 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "12", + "elapsed-time" : "5", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "476", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"5\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":null,\"Address\":null,\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":\"NaN\",\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"5\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":null,\"Address\":null,\"Rooms\":[{\"Description\":null,\"Description_fr\":null,\"Type\":null,\"BaseRate\":\"NaN\",\"BedOptions\":null,\"SleepsCount\":null,\"SmokingAllowed\":null,\"Tags\":[]}]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } }, { "Method" : "GET", - "Uri" : "https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/docs('6')?api-version=2019-05-06", + "Uri" : "https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/docs('6')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "245a021d-1e80-47cf-b5da-435e477efbb4", + "request-id" : "c18b250d-b2ab-4cdc-8548-f4ee480b1ed4", "StatusCode" : "200", - "Date" : "Tue, 10 Sep 2019 03:56:38 GMT", + "Date" : "Wed, 11 Sep 2019 21:58:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "16", + "elapsed-time" : "5", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "336", - "Body" : "{\"@odata.context\":\"https://azs-sdka59908425bfa.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"6\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":null,\"Address\":null,\"Rooms\":[]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk6a819016f8d9.search.windows.net/indexes('hotels')/$metadata#docs(*)/$entity\",\"HotelId\":\"6\",\"HotelName\":null,\"Description\":null,\"Description_fr\":null,\"Category\":null,\"Tags\":[],\"ParkingIncluded\":null,\"SmokingAllowed\":null,\"LastRenovationDate\":null,\"Rating\":null,\"Location\":null,\"Address\":null,\"Rooms\":[]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal" } } ], "variables" : [ ] -} \ No newline at end of file +} diff --git a/sdk/search/azure-search-data/src/test/resources/session-records/countingDocsOfNewIndexGivesZero.json b/sdk/search/azure-search-data/src/test/resources/session-records/countingDocsOfNewIndexGivesZero.json index 81b2320f2bd68..74019ccbcfe3c 100644 --- a/sdk/search/azure-search-data/src/test/resources/session-records/countingDocsOfNewIndexGivesZero.json +++ b/sdk/search/azure-search-data/src/test/resources/session-records/countingDocsOfNewIndexGivesZero.json @@ -1,26 +1,24 @@ { - "networkCallRecords": [ - { - "Method": "GET", - "Uri": "https://azs-sdkfc967636577b.search.windows.net/indexes('hotels')/docs/$count?api-version=2019-05-06", - "Headers": {}, - "Response": { - "Pragma": "no-cache", - "retry-after": "0", - "request-id": "1fa44fac-55fd-4dc8-89ea-9cfea0d520c6", - "StatusCode": "200", - "Date": "Thu, 05 Sep 2019 01:38:15 GMT", - "Strict-Transport-Security": "max-age=15724800; includeSubDomains", - "Cache-Control": "no-cache", - "elapsed-time": "109", - "OData-Version": "4.0", - "Expires": "-1", - "Content-Length": "4", - "Body": "0", - "Preference-Applied": "odata.include-annotations=\"*\"", - "Content-Type": "text/plain" - } + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azs-sdkd040180561eb.search.windows.net/indexes('hotels')/docs/$count?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "eea2431b-5c1c-417a-afc2-91339bf2a54a", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:34:49 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "138", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "4", + "Body" : "0", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "text/plain" } - ], - "variables": [] + } ], + "variables" : [ ] } diff --git a/sdk/search/azure-search-data/src/test/resources/session-records/dynamicDocumentDateTimesRoundTripAsUtc.json b/sdk/search/azure-search-data/src/test/resources/session-records/dynamicDocumentDateTimesRoundTripAsUtc.json new file mode 100644 index 0000000000000..1726f46b3b4af --- /dev/null +++ b/sdk/search/azure-search-data/src/test/resources/session-records/dynamicDocumentDateTimesRoundTripAsUtc.json @@ -0,0 +1,66 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://azs-sdk97534595c5a5.search.windows.net/indexes('books')/docs/search.index?api-version=2019-05-06", + "Headers" : { + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "598bf84a-25c3-474a-b1f3-b3e097c30195", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:35:16 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "384", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "289", + "Body" : "{\"@odata.context\":\"https://azs-sdk97534595c5a5.search.windows.net/indexes('books')/$metadata#Collection(Microsoft.Azure.Search.V2019_05_06.IndexResult)\",\"value\":[{\"key\":\"1\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"2\",\"status\":true,\"errorMessage\":null,\"statusCode\":201}]}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + } + }, { + "Method" : "GET", + "Uri" : "https://azs-sdk97534595c5a5.search.windows.net/indexes('books')/docs('1')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "e62fd17e-a5e7-48c8-84ea-5bec9bf507ba", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:35:19 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "8", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "185", + "Body" : "{\"@odata.context\":\"https://azs-sdk97534595c5a5.search.windows.net/indexes('books')/$metadata#docs(*)/$entity\",\"ISBN\":\"1\",\"Title\":null,\"PublishDate\":\"2010-06-27T00:00:00Z\",\"Author\":null}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + } + }, { + "Method" : "GET", + "Uri" : "https://azs-sdk97534595c5a5.search.windows.net/indexes('books')/docs('2')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "753502f7-bb18-45d6-9941-cf5571aaba51", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:35:19 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "3", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "185", + "Body" : "{\"@odata.context\":\"https://azs-sdk97534595c5a5.search.windows.net/indexes('books')/$metadata#docs(*)/$entity\",\"ISBN\":\"2\",\"Title\":null,\"PublishDate\":\"2010-06-27T00:00:00Z\",\"Author\":null}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + } + } ], + "variables" : [ ] +} diff --git a/sdk/search/azure-search-data/src/test/resources/session-records/indexWithInvalidDocumentThrowsException.json b/sdk/search/azure-search-data/src/test/resources/session-records/indexWithInvalidDocumentThrowsException.json index f05831219ab64..67a718a500153 100644 --- a/sdk/search/azure-search-data/src/test/resources/session-records/indexWithInvalidDocumentThrowsException.json +++ b/sdk/search/azure-search-data/src/test/resources/session-records/indexWithInvalidDocumentThrowsException.json @@ -1,27 +1,27 @@ { - "networkCallRecords" : [ { - "Method" : "POST", - "Uri" : "https://azs-sdk9cb546626e12.search.windows.net/indexes('hotels')/docs/search.index?api-version=2019-05-06", - "Headers" : { - "Content-Type" : "application/json; charset=utf-8" - }, - "Response" : { - "Pragma" : "no-cache", - "retry-after" : "0", - "request-id" : "b2f0825f-a0b3-466f-ad1c-ac82b6280a82", - "StatusCode" : "400", - "Date" : "Sat, 07 Sep 2019 14:34:57 GMT", - "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", - "Cache-Control" : "no-cache", - "elapsed-time" : "88", - "OData-Version" : "4.0", - "Expires" : "-1", - "Content-Length" : "124", - "Body" : "{\"error\":{\"code\":\"\",\"message\":\"The request is invalid. Details: actions : 0: Document key cannot be missing or empty.\\r\\n\"}}", - "Preference-Applied" : "odata.include-annotations=\"*\"", - "Content-Language" : "en", - "Content-Type" : "application/json; odata.metadata=minimal" - } - } ], - "variables" : [ ] -} \ No newline at end of file + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://azs-sdkdc03813479a4.search.windows.net/indexes('hotels')/docs/search.index?api-version=2019-05-06", + "Headers" : { + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "db0e723a-a8ae-460a-bf19-fe4b94091110", + "StatusCode" : "400", + "Date" : "Wed, 11 Sep 2019 21:35:02 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "450", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "124", + "Body" : "{\"error\":{\"code\":\"\",\"message\":\"The request is invalid. Details: actions : 0: Document key cannot be missing or empty.\\r\\n\"}}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Language" : "en", + "Content-Type" : "application/json; odata.metadata=minimal" + } + } ], + "variables" : [ ] +} diff --git a/sdk/search/azure-search-data/src/test/resources/session-records/staticallyTypedDateTimesRoundTripAsUtc.json b/sdk/search/azure-search-data/src/test/resources/session-records/staticallyTypedDateTimesRoundTripAsUtc.json new file mode 100644 index 0000000000000..a635f945ef184 --- /dev/null +++ b/sdk/search/azure-search-data/src/test/resources/session-records/staticallyTypedDateTimesRoundTripAsUtc.json @@ -0,0 +1,66 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://azs-sdk83d3188270ad.search.windows.net/indexes('books')/docs/search.index?api-version=2019-05-06", + "Headers" : { + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "ce656008-0eec-494a-a710-3c5dd0626a79", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:35:49 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "475", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "289", + "Body" : "{\"@odata.context\":\"https://azs-sdk83d3188270ad.search.windows.net/indexes('books')/$metadata#Collection(Microsoft.Azure.Search.V2019_05_06.IndexResult)\",\"value\":[{\"key\":\"1\",\"status\":true,\"errorMessage\":null,\"statusCode\":201},{\"key\":\"2\",\"status\":true,\"errorMessage\":null,\"statusCode\":201}]}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + } + }, { + "Method" : "GET", + "Uri" : "https://azs-sdk83d3188270ad.search.windows.net/indexes('books')/docs('1')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "a50e0503-484c-47de-bb73-4c9073fed487", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:35:50 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "9", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "185", + "Body" : "{\"@odata.context\":\"https://azs-sdk83d3188270ad.search.windows.net/indexes('books')/$metadata#docs(*)/$entity\",\"ISBN\":\"1\",\"Title\":null,\"PublishDate\":\"2010-06-27T00:00:00Z\",\"Author\":null}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + } + }, { + "Method" : "GET", + "Uri" : "https://azs-sdk83d3188270ad.search.windows.net/indexes('books')/docs('2')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "cd3ef593-6244-484b-88cf-b90dde4ccedb", + "StatusCode" : "200", + "Date" : "Wed, 11 Sep 2019 21:35:51 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "10", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "185", + "Body" : "{\"@odata.context\":\"https://azs-sdk83d3188270ad.search.windows.net/indexes('books')/$metadata#docs(*)/$entity\",\"ISBN\":\"2\",\"Title\":null,\"PublishDate\":\"2010-06-27T00:00:00Z\",\"Author\":null}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + } + } ], + "variables" : [ ] +}