Skip to content

Commit 189c8d5

Browse files
authored
Merge pull request #109340 from HeidiSteen/heidist-search
[Azure Cognitive Search] Search explorer as quickstart
2 parents 19e77af + ba5ee73 commit 189c8d5

File tree

6 files changed

+62
-56
lines changed

6 files changed

+62
-56
lines changed

articles/search/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
href: cognitive-search-quickstart-blob.md
2222
- name: Create a knowledge store
2323
href: knowledge-store-create-portal.md
24+
- name: Query with Search explorer
25+
href: search-explorer.md
2426
- name: C#
2527
href: search-get-started-dotnet.md
2628
- name: Java
@@ -231,8 +233,6 @@
231233
href: search-query-simple-examples.md
232234
- name: Use full Lucene syntax
233235
href: search-query-lucene-examples.md
234-
- name: Use Search Explorer (portal)
235-
href: search-explorer.md
236236
- name: Special characters and partial terms
237237
href: search-query-partial-matching.md
238238
- name: Query from Power Apps
-1.4 KB
Loading
19.3 KB
Loading

articles/search/search-create-app-portal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: HeidiSteen
88
ms.author: heidist
99
ms.service: cognitive-search
1010
ms.topic: quickstart
11-
ms.date: 12/05/2019
11+
ms.date: 03/25/2020
1212
---
1313

1414
# Quickstart: Create a search app in the portal (Azure Cognitive Search)
@@ -19,13 +19,13 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
1919

2020
## Prerequisites
2121

22-
You will want to upgrade to the [latest version of Microsoft Edge](https://www.microsoft.com/edge) or use Google's Chrome browser for this quickstart at this time.
22+
Upgrade to the [latest version of Microsoft Edge](https://www.microsoft.com/edge) or use Google's Chrome browser for this quickstart.
2323

2424
[Create an Azure Cognitive Search service](search-create-service-portal.md) or [find an existing service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) under your current subscription. You can use a free service for this quickstart.
2525

2626
[Create an index](search-create-index-portal.md) to use as the basis of your application.
2727

28-
This quickstart uses the built-in Real Estate sample data and index because it has thumbnail images. To create the index used in this exercise, run the **Import data** wizard, choosing the *realestate-us-sample* data source.
28+
This quickstart uses the built-in Real Estate sample data and index because it has thumbnail images (the wizard supports adding images to the results page). To create the index used in this exercise, run the **Import data** wizard, choosing the *realestate-us-sample* data source.
2929

3030
![data source page for sample data](media/search-create-app-portal/import-data-realestate.png)
3131

articles/search/search-explorer.md

Lines changed: 56 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,61 @@
11
---
22
title: Search explorer query tool in Azure portal
33
titleSuffix: Azure Cognitive Search
4-
description: Search explorer is built into the Azure portal, useful for exploring content and validating queries in Azure Cognitive Search. Enter strings for term or phrase search, or fully qualified search expressions with advanced syntax.
4+
description: In this Azure portal quickstart, use Search Explorer to learn query syntax, test query expressions, or inspect a search document. Search explorer queries indexes in Azure Cognitive Search.
55

66
manager: nitinme
77
author: HeidiSteen
88
ms.author: heidist
99
ms.service: cognitive-search
10-
ms.topic: conceptual
11-
ms.date: 11/04/2019
10+
ms.topic: quickstart
11+
ms.date: 03/27/2020
1212
---
1313

14-
# Use Search explorer in the Azure portal for querying documents in Azure Cognitive Search
14+
# Quickstart: Use Search explorer to run queries in the portal
1515

16-
This article shows you how to query an existing Azure Cognitive Search index using **Search explorer** in the Azure portal. You can start Search explorer from the command bar to submit simple or full Lucene query expressions to any existing index in your service.
16+
**Search explorer** is a built-in query tool used for running queries against a search index in Azure Cognitive Search. This tool makes it easy to learn query syntax, test a query or filter expression, or confirm the results of an index refresh by verifying newer content exists.
17+
18+
This quickstart uses **realestate-us-sample-index** to demonstrate Search explorer. Requests are formulated using the [Search REST API](https://docs.microsoft.com/rest/api/searchservice/), with responses returned as JSON documents.
19+
20+
## Prerequisites
21+
22+
+ [Create an Azure Cognitive Search service](search-create-service-portal.md) or [find an existing service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) under your current subscription. You can use a free service for this quickstart.
23+
24+
+ **realestate-us-sample-index** is used for this quickstart. Step through the [**Import data**](search-import-data-portal.md) wizard to generate the index from the built-in samples data source.
25+
26+
## Start Search explorer
27+
28+
1. In the [Azure portal](https://portal.azure.com), open the search service page from the dashboard or [find your service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices).
29+
30+
1. Open Search explorer from the command bar:
1731

1832
![Search explorer command in portal](./media/search-explorer/search-explorer-cmd2.png "Search explorer command in portal")
1933

20-
## Basic search strings
34+
Or use the embedded **Search explorer** tab on an open index:
2135

22-
The following examples assume the built-in real estate sample index. You can create this index using the Import data wizard in the portal, choosing **Samples** as the data source.
36+
![Search explorer tab](./media/search-explorer/search-explorer-tab.png "Search explorer tab")
2337

24-
### Example 1 - empty search
38+
## Unspecified query
2539

26-
For a first look at your content, execute an empty search by clicking **Search** with no terms provided. An empty search is useful as a first query because it returns entire documents so that you can review document composition. On an empty search, there is no search rank and documents are returned in arbitrary order (`"@search.score": 1` for all documents). By default, 50 documents are returned in a search request.
40+
For a first look at content, execute an empty search by clicking **Search** with no terms provided. An empty search is useful as a first query because it returns entire documents so that you can review document composition. On an empty search, there is no search rank and documents are returned in arbitrary order (`"@search.score": 1` for all documents). By default, 50 documents are returned in a search request.
2741

2842
Equivalent syntax for an empty search is `*` or `search=*`.
29-
30-
```Input
43+
44+
```http
3145
search=*
3246
```
3347

3448
**Results**
3549

3650
![Empty query example](./media/search-explorer/search-explorer-example-empty.png "Unqualified or empty query example")
3751

38-
### Example 2 - free text search
52+
## Free text search
3953

40-
Free-form queries, with or without operators, are useful for simulating user-defined queries sent from a custom app to Azure Cognitive Search. Notice that when you provide query terms or expressions, search rank comes into play. The following example illustrates a free text search.
54+
Free-form queries, with or without operators, are useful for simulating user-defined queries sent from a custom app to Azure Cognitive Search. Only those fields attributed as **Searchable** in the index definition are scanned for matches.
4155

42-
```Input
56+
Notice that when you provide search criteria, such as query terms or expressions, search rank comes into play. The following example illustrates a free text search.
57+
58+
```http
4359
Seattle apartment "Lake Washington" miele OR thermador appliance
4460
```
4561

@@ -49,34 +65,35 @@ Free-form queries, with or without operators, are useful for simulating user-def
4965

5066
![Free text query example](./media/search-explorer/search-explorer-example-freetext.png "Free text query example")
5167

52-
### Example 3 - count of matching documents
68+
## Count of matching documents
5369

54-
Add **$count** to get the number of matches found in an index. On an empty search, count is the total number of documents in the index. On a qualified search, it's the number of documents matching the query input.
70+
Add **$count=true** to get the number of matches found in an index. On an empty search, count is the total number of documents in the index. On a qualified search, it's the number of documents matching the query input.
5571

56-
```Input1
72+
```http
5773
$count=true
5874
```
75+
5976
**Results**
6077

6178
![Count of documents example](./media/search-explorer/search-explorer-example-count.png "Count of matching documents in index")
6279

63-
### Example 4 - restrict fields in search results
80+
## Limit fields in search results
6481

65-
Add **$select** to limit results to the explicitly named fields for more readable output in **Search explorer**. To keep the search string and **$count=true**, prefix arguments with **&**.
82+
Add [**$select**](search-query-odata-select.md) to limit results to the explicitly named fields for more readable output in **Search explorer**. To keep the search string and **$count=true**, prefix arguments with **&**.
6683

67-
```Input
84+
```http
6885
search=seattle condo&$select=listingId,beds,baths,description,street,city,price&$count=true
6986
```
7087

7188
**Results**
7289

7390
![Limit fields example](./media/search-explorer/search-explorer-example-selectfield.png "Restrict fields in search results")
7491

75-
### Example 5 - return next batch of results
92+
## Return next batch of results
7693

7794
Azure Cognitive Search returns the top 50 matches based on the search rank. To get the next set of matching documents, append **$top=100,&$skip=50** to increase the result set to 100 documents (default is 50, maximum is 1000), skipping the first 50 documents. Recall that you need to provide search criteria, such as a query term or expression, to get ranked results. Notice that search scores decrease the deeper you reach into search results.
7895

79-
```Input
96+
```http
8097
search=seattle condo&$select=listingId,beds,baths,description,street,city,price&$count=true&$top=100&$skip=50
8198
```
8299

@@ -86,9 +103,9 @@ Azure Cognitive Search returns the top 50 matches based on the search rank. To g
86103

87104
## Filter expressions (greater than, less than, equal to)
88105

89-
Use the **$filter** parameter when you want to specify precise criteria rather than free text search. This example searches for bedrooms greater than 3:
106+
Use the [**$filter**](search-query-odata-filter.md) parameter when you want to specify precise criteria rather than free text search. The field must be attributed as **Filterable** in the index. This example searches for bedrooms greater than 3:
90107

91-
```Input
108+
```http
92109
search=seattle condo&$filter=beds gt 3&$count=true
93110
```
94111

@@ -98,9 +115,9 @@ Use the **$filter** parameter when you want to specify precise criteria rather t
98115

99116
## Order-by expressions
100117

101-
Add **$orderby** to sort results by another field besides search score. An example expression you can use to test this out is:
118+
Add [**$orderby**](search-query-odata-orderby.md) to sort results by another field besides search score. The field must be attributed as **Sortable** in the index. An example expression you can use to test this out is:
102119

103-
```Input
120+
```http
104121
search=seattle condo&$select=listingId,beds,price&$filter=beds gt 3&$count=true&$orderby=price asc
105122
```
106123

@@ -112,40 +129,29 @@ Both **$filter** and **$orderby** expressions are OData constructions. For more
112129

113130
<a name="start-search-explorer"></a>
114131

115-
## How to start Search explorer
116-
117-
1. In the [Azure portal](https://portal.azure.com), open the search service page from the dashboard or [find your service](https://ms.portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) in the service list.
132+
## Takeaways
118133

119-
2. In the service overview page, click **Search explorer**.
120-
121-
![Search explorer command in portal](./media/search-explorer/search-explorer-cmd2.png "Search explorer command in portal")
122-
123-
3. Select the index to query.
124-
125-
![Select the index to query](./media/search-explorer/search-explorer-changeindex-se2.png "Select the index")
126-
127-
4. Optionally, set the API version. By default, the current generally available API version is selected, but you can choose a preview or older API if the syntax you want to use is version-specific.
128-
129-
5. Once the index and API version is selected, enter search terms or fully qualified query expressions in the search bar and click **Search** to execute.
130-
131-
![Enter search terms and click Search](./media/search-explorer/search-explorer-query-string-example.png "Enter search terms and click Search")
132-
133-
Tips for searching in **Search explorer**:
134+
In this quickstart, you used **Search explorer** to query an index using the REST API.
134135

135136
+ Results are returned as verbose JSON documents so that you can view document construction and content, in entirety. You can use query expressions, shown in the examples, to limit which fields are returned.
136137

137138
+ Documents are composed of all fields marked as **Retrievable** in the index. To view index attributes in the portal, click *realestate-us-sample* in the **Indexes** list on the search overview page.
138139

139140
+ Free-form queries, similar to what you might enter in a commercial web browser, are useful for testing an end-user experience. For example, assuming the built-in realestate sample index, you could enter "Seattle apartments lake washington", and then you can use Ctrl-F to find terms within the search results.
140141

141-
+ Query and filter expressions must be articulated in a syntax supported by Azure Cognitive Search. The default is a [simple syntax](https://docs.microsoft.com/rest/api/searchservice/simple-query-syntax-in-azure-search), but you can optionally use [full Lucene](https://docs.microsoft.com/rest/api/searchservice/lucene-query-syntax-in-azure-search) for more powerful queries. [Filter expressions](https://docs.microsoft.com/rest/api/searchservice/odata-expression-syntax-for-azure-search) are an OData syntax.
142+
+ Query and filter expressions are articulated in a syntax supported by Azure Cognitive Search. The default is a [simple syntax](https://docs.microsoft.com/rest/api/searchservice/simple-query-syntax-in-azure-search), but you can optionally use [full Lucene](https://docs.microsoft.com/rest/api/searchservice/lucene-query-syntax-in-azure-search) for more powerful queries. [Filter expressions](https://docs.microsoft.com/rest/api/searchservice/odata-expression-syntax-for-azure-search) are an OData syntax.
143+
144+
## Clean up resources
145+
146+
When you're working in your own subscription, it's a good idea at the end of a project to identify whether you still need the resources you created. Resources left running can cost you money. You can delete resources individually or delete the resource group to delete the entire set of resources.
147+
148+
You can find and manage resources in the portal, using the **All resources** or **Resource groups** link in the left-navigation pane.
142149

150+
If you are using a free service, remember that you are limited to three indexes, indexers, and data sources. You can delete individual items in the portal to stay under the limit.
143151

144152
## Next steps
145153

146-
The following resources provide additional query syntax information and examples.
154+
To learn more about query structures and syntax, use Postman or an equivalent tool to create query expressions that leverage more parts of the API. The [Search REST API](https://docs.microsoft.com/rest/api/searchservice/) is especially helpful for learning and exploration.
147155

148-
+ [Simple query syntax](https://docs.microsoft.com/rest/api/searchservice/simple-query-syntax-in-azure-search)
149-
+ [Lucene query syntax](https://docs.microsoft.com/rest/api/searchservice/lucene-query-syntax-in-azure-search)
150-
+ [Lucene query examples](search-query-lucene-examples.md)
151-
+ [OData Filter expression syntax](https://docs.microsoft.com/rest/api/searchservice/odata-expression-syntax-for-azure-search)
156+
> [!div class="nextstepaction"]
157+
> [Create a basic query in Postman](search-query-simple-examples.md)

articles/search/search-get-started-portal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create a search index in the Azure portal
33
titleSuffix: Azure Cognitive Search
4-
description: In this portal quickstart, learn how to use the Import Data wizard to create, load, and query your first search index in Azure Cognitive Search.
4+
description: In this Azure portal quickstart, use the Import Data wizard to create, load, and query your first search index in Azure Cognitive Search.
55

66
author: tchristiani
77
manager: nitinme

0 commit comments

Comments
 (0)