From 03f1e27f0918d714c5ebafcdad0b79323e7d4589 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Mon, 28 Sep 2015 16:36:40 -0700 Subject: [PATCH 1/3] Search SDK: Tweaking Swagger specs for data plane SDK This change removes some of the ARM-specific definitions as well as leftovers from the Hyak-to-Swagger conversion tool. It also adds all the polymorphic type definitions omitted by the Hyak-to-Swagger tool. --- README.md | 2 +- search/2015-02-28/swagger/searchindex.json | 142 +-- search/2015-02-28/swagger/searchservice.json | 881 +++++++------------ 3 files changed, 364 insertions(+), 661 deletions(-) diff --git a/README.md b/README.md index 96631fd26797..3be883931b37 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The structure of the directory should strictly follow these rules: - The top level folder must be the service name - The second level must be the API versions - The third level must be the format of the specification -- The forth level must be the specifications +- The fourth level must be the specifications The structure should appear like so: ```bash diff --git a/search/2015-02-28/swagger/searchindex.json b/search/2015-02-28/swagger/searchindex.json index 81bd98cfbd28..db7009dedc6a 100644 --- a/search/2015-02-28/swagger/searchindex.json +++ b/search/2015-02-28/swagger/searchindex.json @@ -6,12 +6,10 @@ "version": "2015-02-28" }, "consumes": [ - "application/json", - "text/json" + "application/json;odata.metadata=none" ], "produces": [ - "application/json", - "text/json" + "application/json" ], "paths": { "/docs/$count": { @@ -27,9 +25,6 @@ "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -56,66 +51,30 @@ "$ref": "#/definitions/IndexResult" }, "description": "Gets the list of status information for each document in the indexing request." - }, - "statusCode": { - "type": "string", - "enum": [ - "Continue", - "SwitchingProtocols", - "OK", - "Created", - "Accepted", - "NonAuthoritativeInformation", - "NoContent", - "ResetContent", - "PartialContent", - "MultipleChoices", - "Ambiguous", - "MovedPermanently", - "Moved", - "Found", - "Redirect", - "SeeOther", - "RedirectMethod", - "NotModified", - "UseProxy", - "Unused", - "TemporaryRedirect", - "RedirectKeepVerb", - "BadRequest", - "Unauthorized", - "PaymentRequired", - "Forbidden", - "NotFound", - "MethodNotAllowed", - "NotAcceptable", - "ProxyAuthenticationRequired", - "RequestTimeout", - "Conflict", - "Gone", - "LengthRequired", - "PreconditionFailed", - "RequestEntityTooLarge", - "RequestUriTooLong", - "UnsupportedMediaType", - "RequestedRangeNotSatisfiable", - "ExpectationFailed", - "UpgradeRequired", - "InternalServerError", - "NotImplemented", - "BadGateway", - "ServiceUnavailable", - "GatewayTimeout", - "HttpVersionNotSupported" - ], - "x-ms-enum": "HttpStatusCode" - }, - "requestId": { - "type": "string" } }, "description": "Response containing the status of operations for all documents in the indexing request." }, + "IndexActionType": { + "type": "string", + "enum": [ + "upload", + "merge", + "mergeOrUpload", + "delete" + ], + "x-ms-enum": "IndexActionType", + "description": "Specifies the operation to perform on a document in an indexing batch." + }, + "SearchMode": { + "type": "string", + "enum": [ + "any", + "all" + ], + "x-ms-enum": "SearchMode", + "description": "Specifies whether any or all of the search terms must be matched in order to count the document as a match." + }, "SearchParameters": { "properties": { "filter": { @@ -175,13 +134,8 @@ "description": "Gets or sets the list of field names to include in the full-text search." }, "searchMode": { - "type": "string", + "$ref": "#/definitions/SearchMode", "description": "Gets or sets a value that specifies whether any or all of the search terms must be matched in order to count the document as a match.", - "enum": [ - "any", - "all" - ], - "x-ms-enum": "SearchMode" }, "select": { "type": "array", @@ -260,59 +214,9 @@ } }, "description": "Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors." - }, - "Resource": { - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type" - }, - "location": { - "type": "string", - "description": "Resource location" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-external": true - }, - "SubResource": { - "properties": { - "id": { - "type": "string", - "description": "Resource Id" - } - }, - "x-ms-external": true } }, "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." - }, "ApiVersionParameter": { "name": "api-version", "in": "query", diff --git a/search/2015-02-28/swagger/searchservice.json b/search/2015-02-28/swagger/searchservice.json index 6d3ac2569565..aa367b1ddb4c 100644 --- a/search/2015-02-28/swagger/searchservice.json +++ b/search/2015-02-28/swagger/searchservice.json @@ -2,19 +2,17 @@ "swagger": "2.0", "info": { "title": "SearchServiceClient", - "description": "Client that can be used to manage and query indexes and documents on an Azure Search service.", + "description": "Client that can be used to manage and query indexes and documents, as well as manage other resources, on an Azure Search service.", "version": "2015-02-28" }, "consumes": [ - "application/json", - "text/json" + "application/json;odata.metadata=none" ], "produces": [ - "application/json", - "text/json" + "application/json" ], "paths": { - "/datasources('{name}')": { + "/datasources('{dataSourceName}')": { "put": { "tags": [ "DataSources" @@ -24,19 +22,26 @@ "externalDocs": { "url": "https://msdn.microsoft.com/library/azure/dn946900.aspx" }, + "consumes": "application/json;odata.metadata=minimal", "parameters": [ { - "name": "name", + "name": "dataSourceName", "in": "path", "required": true, "type": "string", - "description": "The definition of the datasource to create or update." + "description": "The name of the datasource to create or update." }, { - "$ref": "#/parameters/ApiVersionParameter" + "name": "dataSource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DataSource" + }, + "description": "The definition of the datasource to create or update." }, { - "$ref": "#/parameters/SubscriptionIdParameter" + "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { @@ -53,9 +58,7 @@ } } } - } - }, - "/datasources('{dataSourceName}')": { + }, "delete": { "tags": [ "DataSources" @@ -75,9 +78,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -108,9 +108,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -136,9 +133,6 @@ "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -159,21 +153,19 @@ "externalDocs": { "url": "https://msdn.microsoft.com/library/azure/dn946876.aspx" }, + "consumes": "application/json;odata.metadata=minimal", "parameters": [ { "name": "dataSource", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DataSourceCreateOrUpdateParameters" + "$ref": "#/definitions/DataSource" }, "description": "The definition of the datasource to create." }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -186,56 +178,44 @@ } } }, - "/indexers('{name}')": { - "put": { + "/indexers('{indexerName}')/search.reset": { + "post": { "tags": [ "Indexers" ], - "operationId": "Indexers_CreateOrUpdate", - "description": "Creates a new Azure Search indexer or updates an indexer if it already exists.", + "operationId": "Indexers_Reset", + "description": "Resets the change tracking state associated with an Azure Search indexer.", "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn946899.aspx" + "url": "https://msdn.microsoft.com/library/azure/dn946897.aspx" }, "parameters": [ { - "name": "name", + "name": "indexerName", "in": "path", "required": true, "type": "string", - "description": "The definition of the indexer to create or update." + "description": "The name of the indexer to reset." }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { - "201": { - "description": "", - "schema": { - "$ref": "#/definitions/Indexer" - } - }, - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/Indexer" - } + "204": { + "description": "" } } } }, - "/indexers('{indexerName}')/search.reset": { + "/indexers('{indexerName}')/search.run": { "post": { "tags": [ "Indexers" ], - "operationId": "Indexers_Reset", - "description": "Resets the change tracking state associated with an Azure Search indexer.", + "operationId": "Indexers_Run", + "description": "Runs an Azure Search indexer on-demand.", "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn946897.aspx" + "url": "https://msdn.microsoft.com/library/azure/dn946885.aspx" }, "parameters": [ { @@ -243,31 +223,28 @@ "in": "path", "required": true, "type": "string", - "description": "The name of the indexer to reset." + "description": "The name of the indexer to run." }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { - "204": { + "202": { "description": "" } } } }, - "/indexers('{indexerName}')/search.run": { - "post": { + "/indexers('{indexerName}')": { + "put": { "tags": [ "Indexers" ], - "operationId": "Indexers_Run", - "description": "Runs an Azure Search indexer on-demand.", + "operationId": "Indexers_CreateOrUpdate", + "description": "Creates a new Azure Search indexer or updates an indexer if it already exists.", "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn946885.aspx" + "url": "https://msdn.microsoft.com/library/azure/dn946899.aspx" }, "parameters": [ { @@ -275,23 +252,36 @@ "in": "path", "required": true, "type": "string", - "description": "The name of the indexer to run." + "description": "The name of the indexer to create or update." }, { - "$ref": "#/parameters/ApiVersionParameter" + "name": "indexer", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Indexer" + }, + "description": "The definition of the indexer to create or update." }, { - "$ref": "#/parameters/SubscriptionIdParameter" + "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { - "202": { - "description": "" + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Indexer" + } + }, + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Indexer" + } } } - } - }, - "/indexers('{indexerName}')": { + }, "delete": { "tags": [ "Indexers" @@ -311,9 +301,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -344,9 +331,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -365,16 +349,13 @@ "Indexers" ], "operationId": "Indexers_List", - "description": "Lists all datasources available for an Azure Search service.", + "description": "Lists all indexers available for an Azure Search service.", "externalDocs": { "url": "https://msdn.microsoft.com/library/azure/dn946883.aspx" }, "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -401,15 +382,12 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/IndexerCreateOrUpdateParameters" + "$ref": "#/definitions/Indexer" }, "description": "The definition of the indexer to create." }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -442,9 +420,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -473,15 +448,12 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/IndexCreateOrUpdateParameters" + "$ref": "#/definitions/Index" }, "description": "The definition of the index to create." }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -505,9 +477,6 @@ "parameters": [ { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -520,7 +489,7 @@ } } }, - "/indexes('{name}')": { + "/indexes('{indexName}')": { "put": { "tags": [ "Indexes" @@ -532,17 +501,23 @@ }, "parameters": [ { - "name": "name", + "name": "indexName", "in": "path", "required": true, "type": "string", "description": "The definition of the index to create or update." }, { - "$ref": "#/parameters/ApiVersionParameter" + "name": "index", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + }, + "description": "The definition of the index to create or update." }, { - "$ref": "#/parameters/SubscriptionIdParameter" + "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { @@ -559,9 +534,7 @@ } } } - } - }, - "/indexes('{indexName}')": { + }, "delete": { "tags": [ "Indexes" @@ -581,9 +554,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -614,9 +584,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -649,9 +616,6 @@ }, { "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" } ], "responses": { @@ -666,222 +630,6 @@ } }, "definitions": { - "IndexResult": { - "properties": {} - }, - "DocumentIndexResult": { - "properties": { - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/IndexResult" - }, - "description": "Gets the list of status information for each document in the indexing request." - }, - "statusCode": { - "type": "string", - "enum": [ - "Continue", - "SwitchingProtocols", - "OK", - "Created", - "Accepted", - "NonAuthoritativeInformation", - "NoContent", - "ResetContent", - "PartialContent", - "MultipleChoices", - "Ambiguous", - "MovedPermanently", - "Moved", - "Found", - "Redirect", - "SeeOther", - "RedirectMethod", - "NotModified", - "UseProxy", - "Unused", - "TemporaryRedirect", - "RedirectKeepVerb", - "BadRequest", - "Unauthorized", - "PaymentRequired", - "Forbidden", - "NotFound", - "MethodNotAllowed", - "NotAcceptable", - "ProxyAuthenticationRequired", - "RequestTimeout", - "Conflict", - "Gone", - "LengthRequired", - "PreconditionFailed", - "RequestEntityTooLarge", - "RequestUriTooLong", - "UnsupportedMediaType", - "RequestedRangeNotSatisfiable", - "ExpectationFailed", - "UpgradeRequired", - "InternalServerError", - "NotImplemented", - "BadGateway", - "ServiceUnavailable", - "GatewayTimeout", - "HttpVersionNotSupported" - ], - "x-ms-enum": "HttpStatusCode" - }, - "requestId": { - "type": "string" - } - }, - "description": "Response containing the status of operations for all documents in the indexing request." - }, - "SearchParameters": { - "properties": { - "filter": { - "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn798921.aspx" - }, - "type": "string", - "description": "Gets or sets the OData $filter expression to apply to the search query." - }, - "highlightFields": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of field names to use for hit highlights. Only searchable fields can be used for hit highlighting." - }, - "highlightPostTag": { - "type": "string", - "description": "Gets or sets a string tag that is appended to hit highlights. Must be set with HighlightPreTag. Default is </em>." - }, - "highlightPreTag": { - "type": "string", - "description": "Gets or sets a string tag that is prepended to hit highlights. Must be set with HighlightPostTag. Default is <em>." - }, - "includeTotalResultCount": { - "type": "boolean", - "description": "Gets or sets a value that specifies whether to fetch the total count of results. Default is false. Setting this value to true may have a performance impact. Note that the count returned is an approximation." - }, - "minimumCoverage": { - "type": "number", - "format": "double", - "description": "Gets or sets a number between 0 and 100 indicating the percentage of the index that must be covered by a search query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 100." - }, - "orderBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to the geo.distance() function. Each expression can be followed by asc to indicate ascending, and desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no OrderBy is specified, the default sort order is descending by document match score. There can be at most 32 Orderby clauses." - }, - "scoringParameters": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of parameter values to be used in scoring functions (for example, referencePointParameter) using the format name:value. For example, if the scoring profile defines a function with a parameter called 'mylocation' the parameter string would be \"mylocation:-122.2,44.8\"(without the quotes)." - }, - "scoringProfile": { - "type": "string", - "description": "Gets or sets the name of a scoring profile to evaluate match scores for matching documents in order to sort the results." - }, - "searchFields": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of field names to include in the full-text search." - }, - "searchMode": { - "type": "string", - "description": "Gets or sets a value that specifies whether any or all of the search terms must be matched in order to count the document as a match.", - "enum": [ - "any", - "all" - ], - "x-ms-enum": "SearchMode" - }, - "select": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included." - }, - "skip": { - "type": "integer", - "format": "int32", - "description": "Gets or sets the number of search results to skip. This value cannot be greater than 100,000. If you need to scan documents in sequence, but cannot use Skip due to this limitation, consider using OrderBy on a totally-ordered key and Filter with a range query instead." - }, - "top": { - "externalDocs": { - "url": "https://msdn.microsoft.com/en-us/library/azure/dn798927.aspx" - }, - "type": "integer", - "format": "int32", - "description": "Gets or sets the number of search results to retrieve. This can be used in conjunction with Skip to implement client-side paging of search results. If results are truncated due to server-side paging, the response will include a continuation token that can be passed to ContinueSearch to retrieve the next page of results. See DocumentSearchResponse.ContinuationToken for more information." - } - }, - "description": "Parameters for filtering, sorting, faceting, paging, and other search query behaviors." - }, - "SuggestParameters": { - "properties": { - "filter": { - "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn798921.aspx" - }, - "type": "string", - "description": "Gets or sets the OData $filter expression to apply to the suggestions query." - }, - "highlightPostTag": { - "type": "string", - "description": "Gets or sets a string tag that is appended to hit highlights. Must be set with HighlightPreTag. If omitted, hit highlighting of suggestions is disabled." - }, - "highlightPreTag": { - "type": "string", - "description": "Gets or sets a string tag that is prepended to hit highlights. Must be set with HighlightPostTag. If omitted, hit highlighting of suggestions is disabled." - }, - "minimumCoverage": { - "type": "number", - "format": "double", - "description": "Gets or sets a number between 0 and 100 indicating the percentage of the index that must be covered by a suggestion query in order for the query to be reported as a success. This parameter can be useful for ensuring search availability even for services with only one replica. The default is 80." - }, - "orderBy": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of OData $orderby expressions by which to sort the results. Each expression can be either a field name or a call to the geo.distance() function. Each expression can be followed by asc to indicate ascending, and desc to indicate descending. The default is ascending order. Ties will be broken by the match scores of documents. If no OrderBy is specified, the default sort order is descending by document match score. There can be at most 32 Orderby clauses." - }, - "searchFields": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of field names to consider when querying for suggestions." - }, - "select": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Gets or sets the list of fields to retrieve. If unspecified, all fields marked as retrievable in the schema are included." - }, - "top": { - "type": "integer", - "format": "int32", - "description": "Gets or sets the number of suggestions to retrieve. This must be a value between 1 and 100. The default is to 5." - }, - "useFuzzyMatching": { - "type": "boolean", - "description": "Gets or sets a value indicating whether to use fuzzy matching for the suggestion query. Default is false. when set to true, the query will find suggestions even if there's a substituted or missing character in the search text. While this provides a better experience in some scenarios it comes at a performance cost as fuzzy suggestion searches are slower and consume more resources." - } - }, - "description": "Parameters for filtering, sorting, fuzzy matching, and other suggestions query behaviors." - }, "DataSourceCredentials": { "properties": { "connectionString": { @@ -908,13 +656,73 @@ "description": "Represents information about the entity (such as Azure SQL table or DocumentDb collection) that will be indexed." }, "DataChangeDetectionPolicy": { - "properties": {}, + "discriminator": "@odata.type", + "properties": { + "@odata.type": { + "type": "string" + } + }, + "required": [ + "@odata.type" + ], "description": "Abstract base class for data change detection policies." }, + "HighWaterMarkChangeDetectionPolicy": { + "description": "Defines a data change detection policy that captures changes based on the value of a high water mark column.", + "allOf": [ + { + "$ref": "#/definitions/DataChangeDetectionPolicy" + }, + { + "properties": { + "highWaterMarkColumnName": { + "type": "string", + "description": "Gets or sets the name of the high water mark column." + } + } + } + ] + }, + "SqlIntegratedChangeTrackingPolicy": { + "description": "Defines a data change detection policy that captures changes using the Integrated Change Tracking feature of Azure SQL Database.", + "allOf": [ + { + "$ref": "#/definitions/DataChangeDetectionPolicy" + } + ] + }, "DataDeletionDetectionPolicy": { - "properties": {}, + "discriminator": "@odata.type", + "properties": { + "@odata.type": { + "type": "string" + } + }, + "required": [ + "@odata.type" + ], "description": "Abstract base class for data deletion detection policies." }, + "SoftDeleteColumnDeletionDetectionPolicy": { + "description": "Defines a data deletion detection policy that implements a soft-deletion strategy. It determines whether an item should be deleted based on the value of a designated 'soft delete' column.", + "allOf": [ + { + "$ref": "#/definitions/DataDeletionDetectionPolicy" + }, + { + "properties": { + "softDeleteColumnName": { + "type": "string", + "description": "Gets or sets the name of the column to use for soft-deletion detection." + }, + "softDeleteMarkerValue": { + "type": "string", + "description": "Gets or sets the marker value that indentifies an item as deleted." + } + } + } + ] + }, "DataSource": { "properties": { "name": { @@ -963,47 +771,10 @@ }, "description": "Response from a List Datasources request. If successful, it includes the full definitions of all datasources." }, - "DataSourceCreateOrUpdateParameters": { - "properties": { - "name": { - "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn857353.aspx" - }, - "type": "string", - "description": "Gets or sets the name of the datasource." - }, - "description": { - "type": "string", - "description": "Gets or sets the description of the datasource." - }, - "type": { - "type": "string", - "description": "Gets or sets the type of the datasource." - }, - "credentials": { - "$ref": "#/definitions/DataSourceCredentials", - "description": "Gets or sets credentials for the datasource." - }, - "container": { - "$ref": "#/definitions/DataContainer", - "description": "Gets or sets the data container for the datasource." - }, - "dataChangeDetectionPolicy": { - "$ref": "#/definitions/DataChangeDetectionPolicy", - "description": "Gets or sets the data change detection policy for the datasource." - }, - "dataDeletionDetectionPolicy": { - "$ref": "#/definitions/DataDeletionDetectionPolicy", - "description": "Gets or sets the data deletion detection policy for the datasource." - } - }, - "description": "Represents a datasource definition in Azure Search, which can be used to configure an indexer." - }, "IndexingSchedule": { "properties": { "interval": { - "type": "integer", - "format": "int64", + "type": "string", "description": "Gets or sets the interval of time between indexer executions." }, "startTime": { @@ -1080,41 +851,6 @@ }, "description": "Response from a List Indexers request. If successful, it includes the full definitions of all indexers." }, - "IndexerCreateOrUpdateParameters": { - "properties": { - "name": { - "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn857353.aspx" - }, - "type": "string", - "description": "Gets or sets the name of the indexer." - }, - "description": { - "type": "string", - "description": "Gets or sets the description of the indexer." - }, - "dataSourceName": { - "type": "string", - "description": "Gets or sets the name of the datasource from which this indexer reads data." - }, - "targetIndexName": { - "type": "string", - "description": "Gets or sets the name of the index to which this indexer writes data." - }, - "schedule": { - "$ref": "#/definitions/IndexingSchedule", - "description": "Gets or sets the schedule for this indexer." - }, - "parameters": { - "$ref": "#/definitions/IndexingParameters", - "description": "Gets or sets parameters for indexer execution." - } - }, - "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn946891.aspx" - }, - "description": "Represents an Azure Search indexer." - }, "ItemError": { "properties": { "key": { @@ -1131,15 +867,8 @@ "IndexerExecutionResult": { "properties": { "status": { - "type": "string", - "description": "Gets the outcome of this indexer execution.", - "enum": [ - "transientFailure", - "success", - "inProgress", - "reset" - ], - "x-ms-enum": "IndexerExecutionStatus" + "$ref": "#/definitions/IndexerExecutionStatus", + "description": "Gets the outcome of this indexer execution." }, "errorMessage": { "type": "string", @@ -1183,17 +912,22 @@ }, "description": "Represents result of an individual indexer execution." }, + "IndexerExecutionStatus": { + "type": "string", + "enum": [ + "transientFailure", + "success", + "inProgress", + "reset" + ], + "x-ms-enum": "IndexerExecutionStatus", + "description": "Represents the status of an individual indexer execution." + }, "IndexerExecutionInfo": { "properties": { "status": { - "type": "string", - "description": "Overall indexer status.", - "enum": [ - "unknown", - "error", - "running" - ], - "x-ms-enum": "IndexerStatus" + "$ref": "#/definitions/IndexerStatus", + "description": "Overall indexer status." }, "lastResult": { "$ref": "#/definitions/IndexerExecutionResult", @@ -1209,6 +943,16 @@ }, "description": "Represents the current status and execution history of an indexer." }, + "IndexerStatus": { + "type": "string", + "enum": [ + "unknown", + "error", + "running" + ], + "x-ms-enum": "IndexerStatus", + "description": "Represents the overall indexer status." + }, "Field": { "properties": { "name": { @@ -1273,7 +1017,11 @@ "description": "Defines weights on index fields for which matches should boost scoring in search queries." }, "ScoringFunction": { + "discriminator": "type", "properties": { + "type": { + "type": "string" + }, "fieldName": { "type": "string", "description": "Gets or sets the name of the field used as input to the scoring function." @@ -1284,22 +1032,156 @@ "description": "Gets or sets a multiplier for the raw score. Must be a positive number not equal to 1.0." }, "interpolation": { - "type": "string", - "description": "Gets or sets a value indicating how boosting will be interpolated across document scores; defaults to \"Linear\".", - "enum": [ - "linear", - "constant", - "quadratic", - "logarithmic" - ], - "x-ms-enum": "ScoringFunctionInterpolation" + "$ref": "#/definitions/ScoringFunctionInterpolation", + "description": "Gets or sets a value indicating how boosting will be interpolated across document scores; defaults to \"Linear\"." } }, + "required": [ + "type" + ], "externalDocs": { "url": "https://msdn.microsoft.com/library/azure/dn798928.aspx" }, "description": "Abstract base class for functions that can modify document scores during ranking." }, + "DistanceScoringFunction": { + "allOf": [ + { + "$ref": "#/definitions/ScoringFunction" + }, + { + "properties": { + "distance": { + "$ref": "#/definitions/DistanceScoringParameters", + "description": "Gets parameter values for the distance scoring function." + } + } + } + ], + "externalDocs": { + "url": "https://msdn.microsoft.com/library/azure/dn798928.aspx" + }, + "description": "Defines a function that boosts scores based on distance from a geographic location." + }, + "DistanceScoringParameters": { + "properties": { + "referencePointParameter": { + "type": "string", + "description": "Gets or sets the name of the parameter passed in search queries to specify the reference location." + }, + "boostingDistance": { + "type": "number", + "format": "double", + "description": "Gets or sets the distance in kilometers from the reference location where the boosting range ends." + } + }, + "description": "Provides parameter values to a distance scoring function." + }, + "FreshnessScoringFunction": { + "allOf": [ + { + "$ref": "#/definitions/ScoringFunction" + }, + { + "properties": { + "freshness": { + "$ref": "#/definitions/FreshnessScoringParameters", + "description": "Gets parameter values for the freshness scoring function." + } + } + } + ], + "externalDocs": { + "url": "https://msdn.microsoft.com/library/azure/dn798928.aspx" + }, + "description": "Defines a function that boosts scores based on the value of a date-time field." + }, + "FreshnessScoringParameters": { + "properties": { + "boostingDuration": { + "type": "string", + "description": "Gets or sets the expiration period after which boosting will stop for a particular document." + } + }, + "description": "Provides parameter values to a freshness scoring function." + }, + "MagnitudeScoringFunction": { + "allOf": [ + { + "$ref": "#/definitions/ScoringFunction" + }, + { + "properties": { + "magnitude": { + "$ref": "#/definitions/MagnitudeScoringParameters", + "description": "Gets parameter values for the magnitude scoring function." + } + } + } + ], + "externalDocs": { + "url": "https://msdn.microsoft.com/library/azure/dn798928.aspx" + }, + "description": "Defines a function that boosts scores based on the magnitude of a numeric field." + }, + "MagnitudeScoringParameters": { + "properties": { + "boostingRangeStart": { + "type": "number", + "format": "double", + "description": "Gets or sets the field value at which boosting starts." + }, + "boostingRangeEnd": { + "type": "number", + "format": "double", + "description": "Gets or sets the field value at which boosting ends." + }, + "constantBoostBeyondRange": { + "type": "boolean", + "description": "Gets or sets a value indicating whether to apply a constant boost for field values beyond the range end value; default is false." + } + }, + "description": "Provides parameter values to a magnitude scoring function." + }, + "TagScoringFunction": { + "allOf": [ + { + "$ref": "#/definitions/ScoringFunction" + }, + { + "properties": { + "tag": { + "$ref": "#/definitions/TagScoringParameters", + "description": "Gets parameter values for the tag scoring function." + } + } + } + ], + "externalDocs": { + "url": "https://msdn.microsoft.com/library/azure/dn798928.aspx" + }, + "description": "Defines a function that boosts scores of documents with string values matching a given list of tags." + }, + "TagScoringParameters": { + "properties": { + "tagsParameter": { + "type": "string", + "description": "Gets or sets the name of the parameter passed in search queries to specify the list of tags to compare against the target field." + } + }, + "description": "Provides parameter values to a tag scoring function." + }, + "ScoringFunctionInterpolation": { + "type": "string", + "enum": [ + "linear", + "constant", + "quadratic", + "logarithmic" + ], + "x-ms-enum": "ScoringFunctionInterpolation", + "description": "Defines the function used to interpolate score boosting across a range of documents." + }, "ScoringProfile": { "properties": { "name": { @@ -1321,16 +1203,8 @@ "description": "Gets the collection of functions that influence the scoring of documents." }, "functionAggregation": { - "type": "string", - "description": "Gets or sets a value indicating how the results of individual scoring functions should be combined. Defaults to \"Sum\". Ignored if there are no scoring functions.", - "enum": [ - "sum", - "average", - "minimum", - "maximum", - "firstMatching" - ], - "x-ms-enum": "ScoringFunctionAggregation" + "$ref": "#/definitions/ScoringFunctionAggregation", + "description": "Gets or sets a value indicating how the results of individual scoring functions should be combined. Defaults to \"Sum\". Ignored if there are no scoring functions." } }, "externalDocs": { @@ -1338,6 +1212,18 @@ }, "description": "Defines parameters for an Azure Search index that influence scoring in search queries." }, + "ScoringFunctionAggregation": { + "type": "string", + "enum": [ + "sum", + "average", + "minimum", + "maximum", + "firstMatching" + ], + "x-ms-enum": "ScoringFunctionAggregation", + "description": "Defines the aggregation function used to combine the results of all the scoring functions in a scoring profile." + }, "CorsOptions": { "properties": { "allowedOrigins": { @@ -1365,12 +1251,8 @@ "description": "Gets or sets the name of the suggester." }, "searchMode": { - "type": "string", - "description": "Gets or sets a value indicating the capabilities of the suggester.", - "enum": [ - "analyzingInfixMatching" - ], - "x-ms-enum": "SuggesterSearchMode" + "$ref": "#/definitions/SuggesterSearchMode", + "description": "Gets or sets a value indicating the capabilities of the suggester." }, "sourceFields": { "type": "array", @@ -1382,46 +1264,13 @@ }, "description": "Defines how the Suggest API should apply to a group of fields in the index." }, - "IndexCreateOrUpdateParameters": { - "properties": { - "name": { - "externalDocs": { - "url": "https://msdn.microsoft.com/library/azure/dn857353.aspx" - }, - "type": "string", - "description": "Gets or sets the name of the index." - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/definitions/Field" - }, - "description": "Gets or sets the fields of the index." - }, - "scoringProfiles": { - "type": "array", - "items": { - "$ref": "#/definitions/ScoringProfile" - }, - "description": "Gets or sets the scoring profiles for the index." - }, - "defaultScoringProfile": { - "type": "string", - "description": "Gets or sets the name of the scoring profile to use if none is specified in the query. If this property is not set and no scoring profile is specified in the query, then default scoring (tf-idf) will be used." - }, - "corsOptions": { - "$ref": "#/definitions/CorsOptions", - "description": "Gets or sets options to control Cross-Origin Resource Sharing (CORS) for the index." - }, - "suggesters": { - "type": "array", - "items": { - "$ref": "#/definitions/Suggester" - }, - "description": "Gets or sets the suggesters for the index." - } - }, - "description": "Represents an index definition in Azure Search, which describes the fields and search behavior of an index." + "SuggesterSearchMode": { + "type": "string", + "enum": [ + "analyzingInfixMatching" + ], + "x-ms-enum": "SuggesterSearchMode", + "description": "Describes the type of suggester to use." }, "Index": { "properties": { @@ -1490,65 +1339,15 @@ } }, "description": "Response from a List Indexes request. If successful, it includes the full definitions of all indexes." - }, - "Resource": { - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type" - }, - "location": { - "type": "string", - "description": "Resource location" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-external": true - }, - "SubResource": { - "properties": { - "id": { - "type": "string", - "description": "Resource Id" - } - }, - "x-ms-external": true } }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client Api Version." + "parameters": { + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } } - } -} \ No newline at end of file + } \ No newline at end of file From f8e4c713a90ff5fea0d702297d42fba3e29eccfb Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Mon, 28 Sep 2015 16:50:06 -0700 Subject: [PATCH 2/3] Search SDK: Fixing Swagger syntax error --- search/2015-02-28/swagger/searchservice.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/2015-02-28/swagger/searchservice.json b/search/2015-02-28/swagger/searchservice.json index aa367b1ddb4c..6baf979688dc 100644 --- a/search/2015-02-28/swagger/searchservice.json +++ b/search/2015-02-28/swagger/searchservice.json @@ -22,7 +22,7 @@ "externalDocs": { "url": "https://msdn.microsoft.com/library/azure/dn946900.aspx" }, - "consumes": "application/json;odata.metadata=minimal", + "consumes": [ "application/json;odata.metadata=minimal" ], "parameters": [ { "name": "dataSourceName", @@ -153,7 +153,7 @@ "externalDocs": { "url": "https://msdn.microsoft.com/library/azure/dn946876.aspx" }, - "consumes": "application/json;odata.metadata=minimal", + "consumes": [ "application/json;odata.metadata=minimal" ], "parameters": [ { "name": "dataSource", From f214f08cfaee9bb24a033e1ba6b74b65cf01a0d7 Mon Sep 17 00:00:00 2001 From: Bruce Johnston Date: Mon, 28 Sep 2015 16:55:33 -0700 Subject: [PATCH 3/3] Search SDK: Another Swagger syntax error --- search/2015-02-28/swagger/searchindex.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search/2015-02-28/swagger/searchindex.json b/search/2015-02-28/swagger/searchindex.json index db7009dedc6a..5ca2482720eb 100644 --- a/search/2015-02-28/swagger/searchindex.json +++ b/search/2015-02-28/swagger/searchindex.json @@ -135,7 +135,7 @@ }, "searchMode": { "$ref": "#/definitions/SearchMode", - "description": "Gets or sets a value that specifies whether any or all of the search terms must be matched in order to count the document as a match.", + "description": "Gets or sets a value that specifies whether any or all of the search terms must be matched in order to count the document as a match." }, "select": { "type": "array",