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/search/cognitive-search-concept-annotations-syntax.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,15 @@ ms.date: 09/16/2022
11
11
---
12
12
# Reference an annotation in an Azure Cognitive Search skillset
13
13
14
-
In this article, you'll learn how to reference *annotations* (or an enrichment node) in skill definitions, using examples to illustrate various scenarios. Skills read inputs and write outputs to nodes in an [enriched document](cognitive-search-working-with-skillsets.md#enrichment-tree) tree, building the tree as the enrichments progress. Any node can be used as an input for further downstream enrichment, or mapped to an output field in an index. This article introduces the syntax and provides examples for specifying a path. For the full syntax, see [Skill context and input annotation language language](cognitive-search-skill-annotation-language.md).
14
+
In this article, you'll learn how to reference *annotations* (or an enrichment node) in skill definitions, using examples to illustrate various scenarios.
15
15
16
-
Paths to an annotation are specified in the "context" and "source" properties:
16
+
Skills read inputs and write outputs to nodes in an [enriched document](cognitive-search-working-with-skillsets.md#enrichment-tree) tree, building the tree as the enrichments progress. Any node can be referenced in an input for further downstream enrichment, or mapped to an output field in an index. This article introduces the syntax and provides examples for specifying a path to a node. For the full syntax, see [Skill context and input annotation language language](cognitive-search-skill-annotation-language.md).
17
+
18
+
Paths to an annotation are specified in the "context" and "source" properties of a skillset, and in [output field mappings](cognitive-search-output-field-mapping.md) in an indexer. Here's an example of paths in a skillset:
17
19
18
20
:::image type="content" source="media/cognitive-search-annotations-syntax/content-source-annotation-path.png" alt-text="Screenshot of a skillset definition with context and source elements highlighted.":::
19
21
20
-
The example in the screenshot illustrates annotation syntax for an item in a Cosmos DB collection.
22
+
The example in the screenshot illustrates the path for an item in a Cosmos DB collection.
21
23
22
24
+ "context" is `/document/HotelId` because the collection is partitioned into documents by the `/HotelId` field.
23
25
@@ -33,19 +35,20 @@ Before reviewing the syntax, let's revisit a few important concepts to better un
33
35
| "annotation" | Within an enriched document, a node that is created and populated by a skill, such as "text" and "layoutText" in the OCR skill, is called an annotation. An enriched document is populated with both annotations and unchanged field values or metadata copied from the source. |
34
36
| "context" | The context in which the enrichment takes place, in terms of which element or component of the document is enriched. By default, the enrichment context is at the `"/document"` level, scoped to individual documents contained in the data source. When a skill runs, the outputs of that skill become [properties of the defined context](#example-2). |
35
37
36
-
## Root nodes and context
38
+
## Common examples
37
39
38
-
An enriched document is created in the "document cracking" stage of indexer execution, when the indexer opens a document or reads in a row from the data source. Initially, the only node in an enriched document is the [root node (`/document`)](cognitive-search-skill-annotation-language.md#document-root), and it's the node from which all other enrichments occur.
40
+
An enriched document is created in the "document cracking" stage of indexer execution, when the indexer opens a document or reads in a row from the data source. Initially, the only node in an enriched document is the [root node (`/document`)](cognitive-search-skill-annotation-language.md#document-root), and it's the node from which all other enrichments occur. All paths start with `/document`.
39
41
40
42
The following list identifies several well-known paths:
41
43
42
44
+`/document` is the root node and indicates an entire blob in Azure Storage, or a row in a SQL table.
43
-
+`/document/{key}` is the syntax for a document or item in a Cosmos DB collection.
44
-
+`/document/content` is the "content" property of a JSON blob.
45
+
+`/document/{key}` is the syntax for a document or item in a Cosmos DB collection, where `{key}` is the actual key, such as "HotelId" in the previous example.
46
+
+`/document/content` is the "content" property of a JSON blob.
47
+
+`/document/{field}` is the syntax for an operation that's performed on a specific field, such as the "/document/Description" field in the previous example.
45
48
+`/document/pages/*` or `/document/sentences/*` become the context if you're breaking a large document into smaller chunks for processing.
46
49
+`/document/normalized_images/*` is created during document cracking if the document contains images. All paths to images start with normalized_images.
47
50
48
-
Examples in this article are based on the *content* field generated automatically by [Azure Blob indexers](search-howto-indexing-azure-blob-storage.md) as part of the [document cracking](search-indexer-overview.md#document-cracking) phase. When referring to documents from a Blob container, use a format such as `"/document/content"`, where the *content* field is part of the *document*.
51
+
Examples in the remainder of this article are based on the "content" field generated automatically by [Azure Blob indexers](search-howto-indexing-azure-blob-storage.md) as part of the [document cracking](search-indexer-overview.md#document-cracking) phase. When referring to documents from a Blob container, use a format such as `"/document/content"`, where the "content" field is part of the "document".
0 commit comments