Skip to content

Commit 98b3b43

Browse files
committed
Added screenshot
1 parent 41ebd03 commit 98b3b43

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed
99.7 KB
Loading

articles/search/search-query-create.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,37 @@ In the portal, when you open an index, you can work with Search Explorer alongsi
5555

5656
1. Open **Indexes** and select an index.
5757

58-
1. An index opens to the [**Search explorer**](search-explorer.md) tab so that you can query right away. A query string can use simple or full syntax, with support for all query parameters (filter, select, searchFields, and so on). Here's a full text search query expression that works for the Hotels sample index:
58+
1. An index opens to the [**Search explorer**](search-explorer.md) tab so that you can query right away. A query string can use simple or full syntax, with support for all query parameters (filter, select, searchFields, and so on).
59+
60+
Here's a full text search query expression that works for the Hotels sample index:
5961

6062
`search=pool spa +airport&$searchFields=Description,Tags&$select=HotelName,Description,Category&$count=true`
6163

64+
The following screenshot illustrates the query and response:
65+
66+
:::image type="content" source="media/search-explorer/search-explorer-full-text-query-hotels.png" alt-text="Screenshot of Search Explorer with a full text query.":::
67+
6268
Notice that you can change the REST API version if you require search behaviors from a specific version, or switch to **JSON view** if you want to paste in the JSON definition of a query. For more information about what a JSON definition looks like, see [Search Documents (REST)](/rest/api/searchservice/search-documents).
6369

6470
### [**REST API**](#tab/rest-text-query)
6571

66-
The [Postman app](https://www.postman.com/downloads/) can function as a query client. Using the app, you can connect to your search service and send [Search Documents (REST)](/rest/api/searchservice/search-documents) requests. Numerous tutorials and examples demonstrate REST clients for querying indexing.
72+
[Postman app](https://www.postman.com/downloads/) is useful for working with the REST APIs, such as [Search Documents (REST)](/rest/api/searchservice/search-documents).
6773

6874
Start with [Create a search index using REST and Postman](search-get-started-rest.md) for step-by-step instructions for setting up requests.
6975

70-
Each request is standalone, so you must provide the endpoint, index name, and API version on every request. Other properties, Content-Type and API key, are passed on the request header. For more information, see [Search Documents (REST)](/rest/api/searchservice/search-documents) for help with formulating query requests.
76+
The following example calls the REST API for full text search:
77+
78+
```http
79+
POST https://[service name].search.windows.net/indexes/hotels-sample-index/docs/search?api-version=2020-06-30
80+
{
81+
"search": "NY +view",
82+
"queryType": "simple",
83+
"searchMode": "all",
84+
"searchFields": "HotelName, Description, Address/City, Address/StateProvince, Tags",
85+
"select": "HotelName, Description, Address/City, Address/StateProvince, Tags",
86+
"count": "true"
87+
}
88+
```
7189

7290
### [**Azure SDKs**](#tab/sdk-text-query)
7391

articles/search/search-query-overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ms.date: 09/25/2023
1313

1414
# Querying in Azure Cognitive Search
1515

16-
Azure Cognitive Search offers a rich query language to support a broad range of scenarios, from free text search, to highly-specified query patterns. This article describes query requests and the kinds of queries you can create.
16+
Azure Cognitive Search offers a rich query language to support a broad range of scenarios, from free text search, to highly specified query patterns. This article describes query requests and the kinds of queries you can create.
1717

1818
In Cognitive Search, a query is a full specification of a round-trip **`search`** operation, with parameters that both inform query execution and shape the response coming back. To illustrate, the following query example calls the [Search Documents (REST API)](/rest/api/searchservice/search-documents). It's a parameterized, free text query with a boolean operator, targeting the [hotels-sample-index](search-get-started-portal.md) documents collection. It also selects which fields are returned in results.
1919

@@ -63,7 +63,7 @@ With a few notable exceptions, a full text query request iterates over inverted
6363

6464
Full text search accepts terms or phrases passed in a **`search`** parameter in all "searchable" fields in your index. Optional boolean operators in the query string can specify inclusion or exclusion criteria. Both the simple parser and full parser support full text search.
6565

66-
In Cognitive Search, full text search is built on the Apache Lucene query engine. Query strings in full text search undergo lexical analysis to make scans more efficient. Analysis includes lower-casing all terms, removing stop words like "the", and reducing terms to primitive root forms. The default analyzer is Standard Lucene.
66+
In Cognitive Search, full text search is built on the Apache Lucene query engine. Query strings in full text search undergo lexical analysis to make scans more efficient. Analysis includes lower-casing all terms, removing stop words like "the" and reducing terms to primitive root forms. The default analyzer is Standard Lucene.
6767

6868
When matching terms are found, the query engine reconstitutes a search document containing the match using the document key or ID to assemble field values, ranks the documents in order of relevance, and returns the top 50 (by default) in the response or a different number if you specified **`top`**.
6969

@@ -74,7 +74,7 @@ If you're implementing full text search, understanding how your content is token
7474
7575
## Autocomplete and suggested queries
7676

77-
[Autocomplete or suggested results](search-add-autocomplete-suggestions.md) are alternatives to **`search`** that fire successive query requests based on partial string inputs (after each character) in a search-as-you-type experience. You can use **`autocomplete`** and **`suggestions`** parameter together or separately, as described in [this tutorial](tutorial-csharp-type-ahead-and-suggestions.md), but you cannot use them with **`search`**. Both completed terms and suggested queries are derived from index contents. The engine never returns a string or suggestion that is non-existent in your index. For more information, see [Autocomplete (REST API)](/rest/api/searchservice/autocomplete) and [Suggestions (REST API)](/rest/api/searchservice/suggestions).
77+
[Autocomplete or suggested results](search-add-autocomplete-suggestions.md) are alternatives to **`search`** that fire successive query requests based on partial string inputs (after each character) in a search-as-you-type experience. You can use **`autocomplete`** and **`suggestions`** parameter together or separately, as described in [this tutorial](tutorial-csharp-type-ahead-and-suggestions.md), but you can't use them with **`search`**. Both completed terms and suggested queries are derived from index contents. The engine never returns a string or suggestion that is nonexistent in your index. For more information, see [Autocomplete (REST API)](/rest/api/searchservice/autocomplete) and [Suggestions (REST API)](/rest/api/searchservice/suggestions).
7878

7979
## Filter search
8080

@@ -119,7 +119,7 @@ An advanced query form depends on the Full Lucene parser and operators that trig
119119

120120
## Next steps
121121

122-
For a closer look at query implementation, review the examples for each syntax. If you are new to full text search, a closer look at what the query engine does might be an equally good choice.
122+
For a closer look at query implementation, review the examples for each syntax. If you're new to full text search, a closer look at what the query engine does might be an equally good choice.
123123

124124
+ [Simple query examples](search-query-simple-examples.md)
125125
+ [Lucene syntax query examples for building advanced queries](search-query-lucene-examples.md)

0 commit comments

Comments
 (0)