diff --git a/src/Search/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs b/src/Search/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs index 51bfa9c1f90f..0c7483a80529 100644 --- a/src/Search/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs +++ b/src/Search/Microsoft.Azure.Search/Customizations/Indexers/Models/IndexingParametersExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Search.Models /// public static class IndexingParametersExtensions { + private const string ParsingModeKey = "parsingMode"; + /// /// Specifies that the indexer will index only the storage metadata and completely skip the document extraction process. This is useful when /// you don't need the document content, nor do you need any of the content type-specific metadata properties. @@ -110,6 +112,21 @@ public static IndexingParameters SetBlobExtractionMode(this IndexingParameters p return Configure(parameters, "dataToExtract", (string)extractionMode); } + /// + /// Tells the indexer to assume that all blobs contain JSON, which it will then parse such that each blob's JSON will map to a single + /// document in the Azure Search index. + /// See for details. + /// + /// IndexingParameters to configure. + /// + /// This option only applies to indexers that index Azure Blob Storage. + /// + /// The IndexingParameters instance. + public static IndexingParameters ParseJson(this IndexingParameters parameters) + { + return Configure(parameters, ParsingModeKey, "json"); + } + /// /// Specifies that BlobExtractionMode.StorageMetadata blob extraction mode will be /// automatically used for blobs of unsupported content types. The default is false. diff --git a/src/Search/Microsoft.Azure.Search/Properties/AssemblyInfo.cs b/src/Search/Microsoft.Azure.Search/Properties/AssemblyInfo.cs index cf939eed5651..f163eb6eabf7 100644 --- a/src/Search/Microsoft.Azure.Search/Properties/AssemblyInfo.cs +++ b/src/Search/Microsoft.Azure.Search/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ [assembly: AssemblyDescription("Makes it easy to develop a .NET application that uses Azure Search.")] [assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyFileVersion("3.0.2.0")] +[assembly: AssemblyFileVersion("3.0.3.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/Search/Microsoft.Azure.Search/project.json b/src/Search/Microsoft.Azure.Search/project.json index 18e8a2ff0eb8..cae4c5ae7630 100644 --- a/src/Search/Microsoft.Azure.Search/project.json +++ b/src/Search/Microsoft.Azure.Search/project.json @@ -1,5 +1,5 @@ { - "version": "3.0.2", + "version": "3.0.3", "title": "Microsoft Azure Search Library", "description": "Makes it easy to develop a .NET application that uses Azure Search.", "authors": [ "Microsoft" ], @@ -11,7 +11,7 @@ "iconUrl": "http://go.microsoft.com/fwlink/?LinkID=288890", "tags": [ "Microsoft Azure Search", "REST HTTP client", "search", "azureofficial", "windowsazureofficial" ], "requireLicenseAcceptance": true, - "releaseNotes": "This is the newest major version of the Azure Search .NET SDK, based on version 2016-09-01 of the Azure Search REST API. New in this version is support for indexing Azure Blob and Table storage, indexer field mappings, custom analyzers, and ETags. Also included is support for reflection-based field definitions via the FieldBuilder class, thanks to a contribution from Ian Griffiths (https://github.com/idg10). See this article for help on migrating to the latest version: http://aka.ms/search-sdk-upgrade." + "releaseNotes": "This is the newest major version of the Azure Search .NET SDK, based on version 2016-09-01 of the Azure Search REST API. New in this version is support for indexing Azure Blob storage (including parsing of JSON blobs), indexing Azure Table storage, indexer field mappings, custom analyzers, and ETags. Also included is support for reflection-based field definitions via the FieldBuilder class, thanks to a contribution from Ian Griffiths (https://github.com/idg10). See this article for help on migrating to the latest version: http://aka.ms/search-sdk-upgrade." }, "buildOptions": { diff --git a/src/Search/Search.Management.Tests/project.json b/src/Search/Search.Management.Tests/project.json index a423539cee4e..72901a1e3ff7 100644 --- a/src/Search/Search.Management.Tests/project.json +++ b/src/Search/Search.Management.Tests/project.json @@ -33,7 +33,7 @@ "Microsoft.Rest.ClientRuntime.Azure": "[3.3.4,4.0)", "Microsoft.Azure.Management.ResourceManager": "1.1.1-preview", "Microsoft.Azure.Management.Search": "1.0.1", - "Microsoft.Azure.Search": "3.0.2", + "Microsoft.Azure.Search": "3.0.3", "xunit": "2.2.0-beta2-build3300", "dotnet-test-xunit": "2.2.0-preview2-build1029" } diff --git a/src/Search/Search.Tests/Tests/IndexingParametersTests.cs b/src/Search/Search.Tests/Tests/IndexingParametersTests.cs index aa5fb57ca154..20057ced6ff4 100644 --- a/src/Search/Search.Tests/Tests/IndexingParametersTests.cs +++ b/src/Search/Search.Tests/Tests/IndexingParametersTests.cs @@ -11,6 +11,15 @@ namespace Microsoft.Azure.Search.Tests public sealed class IndexingParametersTests { + private const string ExpectedParsingModeKey = "parsingMode"; + + [Fact] + public void ParseJsonSetCorrectly() + { + var parameters = new IndexingParameters().ParseJson(); + AssertHasConfigItem(parameters, ExpectedParsingModeKey, "json"); + } + [Fact] public void IndexFileNameExtensionsSetCorrectly() { diff --git a/src/Search/Search.Tests/project.json b/src/Search/Search.Tests/project.json index dd3105207293..a314f91a010f 100644 --- a/src/Search/Search.Tests/project.json +++ b/src/Search/Search.Tests/project.json @@ -29,7 +29,7 @@ "version": "1.0.0" }, "Search.Management.Tests": "1.0.0", - "Microsoft.Azure.Search": "3.0.2", + "Microsoft.Azure.Search": "3.0.3", "Microsoft.AspNetCore.WebUtilities": "1.0.0" } } \ No newline at end of file