You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Bing-Autosuggest/quickstarts/csharp.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,25 @@
1
1
---
2
2
title: "Quickstart: Suggest search queries with the Bing Autosuggest REST API and C#"
3
3
titleSuffix: Azure Cognitive Services
4
-
description: Learn how to quickly start suggesting search terms in real-time with the Bing Autosuggest API.
4
+
description: Learn how to quickly start suggesting search terms in realtime with the Bing Autosuggest API.
5
5
services: cognitive-services
6
6
author: aahill
7
7
manager: nitinme
8
8
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-autosuggest
11
11
ms.topic: quickstart
12
-
ms.date: 03/24/2020
12
+
ms.date: 05/06/2020
13
13
ms.author: aahi
14
14
---
15
15
# Quickstart: Suggest search queries with the Bing Autosuggest REST API and C#
16
16
17
-
Use this quickstart to begin making calls to the Bing Autosuggest API and getting the JSON response. This simple C# application sends a partial search query to the API, and returns suggestions for searches. While this application is written in C#, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/dotnet/Search/BingAutosuggestv7.cs).
17
+
Follow this quickstart to learn how to make calls to the Bing Autosuggest API and read the JSON response. This simple C# application sends a partial search query to the API, and returns suggestions for searches. While this application is written in C#, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/dotnet/Search/BingAutosuggestv7.cs).
18
18
19
19
## Prerequisites
20
20
21
21
* Any edition of [Visual Studio 2017 or later](https://www.visualstudio.com/downloads/).
22
-
* If you are using Linux/MacOS, this application can be run using [Mono](https://www.mono-project.com/).
22
+
* If you're using Linux/MacOS, this application can be run using [Mono](https://www.mono-project.com/).
@@ -35,7 +35,7 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
35
35
usingSystem.Text;
36
36
```
37
37
38
-
2. Inanew class, create variables for your API host and path, [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a partial search query. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
38
+
2. Inanew class, create variables for your API host and path, [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a partial search query. Use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Bing-Autosuggest/quickstarts/java.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,21 @@
1
1
---
2
2
title: "Quickstart: Suggest search queries with the Bing Autosuggest REST API and Java"
3
3
titleSuffix: Azure Cognitive Services
4
-
description: Learn how to quickly start suggesting search terms in real-time with the Bing Autosuggest API.
4
+
description: Learn how to quickly start suggesting search terms in realtime with the Bing Autosuggest API.
5
5
services: cognitive-services
6
6
author: aahill
7
7
manager: nitinme
8
8
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-autosuggest
11
11
ms.topic: quickstart
12
-
ms.date: 03/24/2020
12
+
ms.date: 05/06/2020
13
13
ms.author: aahi
14
14
---
15
15
16
16
# Quickstart: Suggest search queries with the Bing Autosuggest REST API and Java
17
17
18
-
19
-
Use this quickstart to begin making calls to the Bing Autosuggest API and getting the JSON response. This simple Java application sends a partial search query to the API, and returns suggestions for searches. While this application is written in Java, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/java/Search/BingAutosuggestv7.java)
18
+
Follow this quickstart to learn how to make calls to the Bing Autosuggest API and read the JSON response. This simple Java application sends a partial search query to the API, and returns suggestions for searches. While this application is written in Java, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/java/Search/BingAutosuggestv7.java)
20
19
21
20
## Prerequisites
22
21
@@ -40,7 +39,7 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
40
39
importcom.google.gson.JsonParser;
41
40
```
42
41
43
-
2.Create variables for your subscription key, the API host and path, your [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a search query. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
42
+
2.Create variables for your subscription key, the API host and path, your [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a search query. Use the global endpoint below, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
44
43
45
44
```java
46
45
staticString subscriptionKey ="enter key here";
@@ -69,7 +68,7 @@ public static String prettify(String json_text) {
69
68
70
69
1. Create a new method named `get_suggestions()` and perform the following steps:
71
70
72
-
1. construct the URL for your request by combining your API host, path, and encoding your search query. Be sure to url-encode the query before appending it. Create a parameters string for your query by appending the market code to the `mkt=` parameter, and your query to the `q=` parameter.
71
+
1. Construct the URL for your request by combining your API host, path, and encoding your search query. Be sure to url-encode the query before appending it. Create a parameters string for your query by appending the market code to the `mkt=` parameter, and your query to the `q=` parameter.
73
72
74
73
```java
75
74
@@ -80,7 +79,7 @@ public static String prettify(String json_text) {
80
79
}
81
80
```
82
81
83
-
2. Create a new URL for the request with the API host, path, and parameters created above.
82
+
2. Create a new URL for the request with the API host, path, and parameters that you created in the previous step.
84
83
85
84
```java
86
85
//...
@@ -99,7 +98,7 @@ public static String prettify(String json_text) {
99
98
//...
100
99
```
101
100
102
-
4. Read in the API response to a `StringBuilder`. After the response has been captured, close the `InputStreamReader` stream, and return the response.
101
+
4. Store the API response in `StringBuilder`. After the response has been captured, close the `InputStreamReader` stream, and return the response.
103
102
104
103
```java
105
104
//...
@@ -115,7 +114,7 @@ public static String prettify(String json_text) {
115
114
return response.toString();
116
115
```
117
116
118
-
2. In the main function of your application, call `get_suggestions()`, and print the response using `prettify()`.
117
+
2. In the main function of your application, call `get_suggestions()`, and print the response by using `prettify()`.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Bing-Autosuggest/quickstarts/nodejs.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
---
2
2
title: "Quickstart: Suggest search queries with the Bing Autosuggest REST API and Node.js"
3
3
titleSuffix: Azure Cognitive Services
4
-
description: Learn how to quickly start suggesting search terms in real-time with the Bing Autosuggest API.
4
+
description: Learn how to quickly start suggesting search terms in realtime with the Bing Autosuggest API.
5
5
services: cognitive-services
6
6
author: aahill
7
7
manager: nitinme
8
8
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-autosuggest
11
11
ms.topic: quickstart
12
-
ms.date: 03/24/2020
12
+
ms.date: 05/06/2020
13
13
ms.author: aahi
14
14
---
15
15
16
16
# Quickstart: Suggest search queries with the Bing Autosuggest REST API and Node.js
17
17
18
-
Use this quickstart to begin making calls to the Bing Autosuggest API and getting the JSON response. This simple Node.js application sends a partial search query to the API, and returns suggestions for searches. While this application is written in JavaScript, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/nodejs/Search/BingAutosuggestv7.js)
18
+
Follow this quickstart to learn how to make calls to the Bing Autosuggest API and read the JSON response. This simple Node.js application sends a partial search query to the API, and returns suggestions for searches. While this application is written in JavaScript, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/nodejs/Search/BingAutosuggestv7.js)
19
19
20
20
## Prerequisites
21
21
@@ -33,7 +33,7 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
33
33
let https =require ('https');
34
34
```
35
35
36
-
2. Create variables for the API endpoint host and path, your subscription key, [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a search term. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
36
+
2. Create variables for the API endpoint host and path, your subscription key, [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a search term. Use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
37
37
38
38
```javascript
39
39
// Replace the subscriptionKey string value with your valid subscription key.
@@ -48,7 +48,7 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
48
48
49
49
## Construct the search request and query.
50
50
51
-
1. Create a parameters string for your query by appending the market code to the `mkt=` parameter, and your query to the `q=` parameter.
51
+
1. Create a parameters string for your query by appending the market code to the `mkt=` parameter, and your query to the `&q=` parameter.
52
52
53
53
```javascript
54
54
let params = '?mkt=' + mkt + '&q=' + query;
@@ -70,17 +70,18 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
70
70
}
71
71
```
72
72
73
-
1. In the same function, use the request library to send your query to the API. `response_handler`will be defined in the next section.
73
+
1. In the same function, use the request library to send your query to the API. `response_handler`is defined in the next section.
74
74
75
-
```javascript
75
+
```javascript
76
76
//...
77
77
let req =https.request(request_params, response_handler);
78
78
req.end();
79
79
```
80
80
81
81
## Create a search handler
82
82
83
-
1. define a function named `response_handler` that takes an HTTP call, `response`, as a parameter. Do the following steps within this function:
83
+
1. Define a function named `response_handler` that takes an HTTP call, `response`, as a parameter.
84
+
Do the following steps within this function:
84
85
85
86
1. Define a variable to contain the body of the JSON response.
86
87
@@ -90,15 +91,15 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
90
91
};
91
92
```
92
93
93
-
2. Store the body of the response when the **data** flag is called
94
+
2. Store the body of the response when the `data` flag is called
94
95
95
96
```javascript
96
97
response.on ('data', function (d) {
97
98
body += d;
98
99
});
99
100
```
100
101
101
-
3. When an **end** flag is signaled, user`JSON.parse()` and `JSON.stringify()` to print the response.
102
+
3. When an `end` flag is signaled, use`JSON.parse()` and `JSON.stringify()` to print the response.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Bing-Autosuggest/quickstarts/php.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,21 @@
1
1
---
2
2
title: "Quickstart: Suggest search queries with the Bing Autosuggest REST API and PHP"
3
3
titleSuffix: Azure Cognitive Services
4
-
description: Learn how to quickly start suggesting search terms in real-time with the Bing Autosuggest API.
4
+
description: Learn how to quickly start suggesting search terms in realtime with the Bing Autosuggest API.
5
5
services: cognitive-services
6
6
author: aahill
7
7
manager: nitinme
8
8
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-autosuggest
11
11
ms.topic: quickstart
12
-
ms.date: 03/24/2020
12
+
ms.date: 05/06/2020
13
13
ms.author: aahi
14
14
---
15
15
16
16
# Quickstart: Suggest search queries with the Bing Autosuggest REST API and PHP
17
17
18
-
Use this quickstart to begin making calls to the Bing Autosuggest API and getting the JSON response. This simple PHP application sends a partial search query to the API, and returns suggestions for searches. While this application is written in PHP, the API is a RESTful Web service compatible with most programming languages.
18
+
Follow this quickstart to learn how to make calls to the Bing Autosuggest API and read the JSON response. This simple PHP application sends a partial search query to the API, and returns suggestions for searches. While this application is written in PHP, the API is a RESTful Web service compatible with most programming languages.
19
19
20
20
## Prerequisites
21
21
@@ -27,8 +27,8 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
27
27
28
28
1. Create a new PHP project in your favorite IDE.
29
29
2. Add the code provided below.
30
-
3. Replace the `subscriptionKey` value with an access key valid for your subscription.
31
-
4.You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
30
+
3. Replace the `subscriptionKey` value with an access key that's valid for your subscription.
31
+
4.Use the global endpoint in the code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Bing-Autosuggest/quickstarts/python.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
2
title: "Quickstart: Suggest search queries with the Bing Autosuggest REST API and Python"
3
3
titleSuffix: Azure Cognitive Services
4
-
description: Learn how to quickly start suggesting search terms in real-time with the Bing Autosuggest API.
4
+
description: Learn how to quickly start suggesting search terms in realtime with the Bing Autosuggest API.
5
5
services: cognitive-services
6
6
author: aahill
7
7
manager: nitinme
8
8
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-autosuggest
11
11
ms.topic: quickstart
12
-
ms.date: 03/24/2020
12
+
ms.date: 05/06/2020
13
13
ms.author: aahi
14
14
---
15
15
# Quickstart: Suggest search queries with the Bing Autosuggest REST API and Python
16
16
17
-
Use this quickstart to begin making calls to the Bing Autosuggest API and getting the JSON response. This simple Python application sends a partial search query to the API, and returns suggestions for searches. While this application is written in Python, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/python/Search/BingAutosuggestv7.py)
17
+
Follow this quickstart to learn how to make calls to the Bing Autosuggest API and read the JSON response. This simple Python application sends a partial search query to the API, and returns suggestions for searches. While this application is written in Python, the API is a RESTful Web service compatible with most programming languages. The source code for this sample is available on [GitHub](https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/python/Search/BingAutosuggestv7.py)
18
18
19
19
## Prerequisites
20
20
@@ -30,7 +30,7 @@ Use this quickstart to begin making calls to the Bing Autosuggest API and gettin
30
30
import http.client, urllib.parse, json
31
31
```
32
32
33
-
2. Create variables for your API host and path, [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and a partial search query. You can use the global endpoint below, or the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
33
+
2. Create variables for your API host and path, [market code](https://docs.microsoft.com/rest/api/cognitiveservices-bingsearch/bing-autosuggest-api-v7-reference#market-codes), and partial search query. Use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
0 commit comments