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
Before continuing with this article, you need an Azure AI Search resource to work with. If you don't have a resource, [create your resource](search-create-service-portal.md) now. [Enable role-based access control (RBAC)](search-security-enable-roles.md) for the resource.
34
-
35
-
### Install Azure Identity client library
31
+
## Install Azure Identity client library
36
32
37
33
To use a keyless approach, update your AI Search enabled code with the Azure Identity client library.
38
34
39
-
####[.NET](#tab/csharp)
35
+
### [.NET](#tab/csharp)
40
36
41
37
Install the [Azure Identity client library for .NET](https://www.nuget.org/packages/Azure.Identity):
42
38
43
39
```dotnetcli
44
40
dotnet add package Azure.Identity
45
41
```
46
42
47
-
####[Java](#tab/java)
43
+
### [Java](#tab/java)
48
44
49
45
Install the [Azure Identity client library for Java](https://mvnrepository.com/artifact/com.azure/azure-identity) with the following POM file:
50
46
@@ -60,15 +56,15 @@ Install the [Azure Identity client library for Java](https://mvnrepository.com/a
60
56
</dependencyManagement>
61
57
```
62
58
63
-
####[JavaScript](#tab/javascript)
59
+
### [JavaScript](#tab/javascript)
64
60
65
61
Install the [Azure Identity client library for JavaScript](https://www.npmjs.com/package/@azure/identity):
66
62
67
63
```console
68
64
npm install --save @azure/identity
69
65
```
70
66
71
-
####[Python](#tab/python)
67
+
### [Python](#tab/python)
72
68
73
69
Install the [Azure Identity client library for Python](https://pypi.org/project/azure-identity/):
74
70
@@ -82,7 +78,7 @@ pip install azure-identity
82
78
83
79
The Azure Identity library's `DefaultAzureCredential` allows you to run the same code in the local development environment and in the Azure cloud. Create a single credential and reuse the credential instance as needed to take advantage of token caching.
84
80
85
-
####[.NET](#tab/csharp)
81
+
### [.NET](#tab/csharp)
86
82
87
83
For more information on `DefaultAzureCredential` for .NET, see [Azure Identity client library for .NET](/dotnet/api/overview/azure/identity-readme#defaultazurecredential).
For more information on `DefaultAzureCredential` for Java, see [Azure Identity client library for Java](/java/api/overview/azure/identity-readme#defaultazurecredential).
110
106
@@ -148,7 +144,7 @@ SearchIndexAsyncClient searchIndexAsyncClient = new SearchIndexClientBuilder()
148
144
.buildAsyncClient();
149
145
```
150
146
151
-
####[JavaScript](#tab/javascript)
147
+
### [JavaScript](#tab/javascript)
152
148
153
149
For more information on `DefaultAzureCredential` for JavaScript, see [Azure Identity client library for JavaScript](/javascript/api/overview/azure/identity-readme#defaultazurecredential).
154
150
@@ -178,7 +174,7 @@ const indexClient = new SearchIndexClient(
178
174
);
179
175
```
180
176
181
-
####[Python](#tab/python)
177
+
### [Python](#tab/python)
182
178
183
179
For more information on `DefaultAzureCredential` for Python, see [Azure Identity client library for Python](/python/api/overview/azure/identity-readme#defaultazurecredential).
Copy file name to clipboardExpand all lines: articles/search/knowledge-store-projection-overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Projection concepts
3
3
titleSuffix: Azure AI Search
4
-
description: Introduces projection concepts and best practices. If you are creating a knowledge store in Azure AI Search, projections determine the type, quantity, and composition of objects in Azure Storage.
4
+
description: Introduces projection concepts and best practices. If you're creating a knowledge store in Azure AI Search, projections determine the type, quantity, and composition of objects in Azure Storage.
5
5
6
6
manager: nitinme
7
7
author: HeidiSteen
@@ -10,7 +10,7 @@ ms.service: azure-ai-search
10
10
ms.custom:
11
11
- ignite-2023
12
12
ms.topic: conceptual
13
-
ms.date: 12/10/2024
13
+
ms.date: 06/17/2025
14
14
---
15
15
16
16
# Knowledge store "projections" in Azure AI Search
Copy file name to clipboardExpand all lines: articles/search/knowledge-store-projection-shape.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.service: azure-ai-search
8
8
ms.custom:
9
9
- ignite-2023
10
10
ms.topic: conceptual
11
-
ms.date: 12/10/2024
11
+
ms.date: 06/17/2025
12
12
---
13
13
14
14
# Shaping data for projection into a knowledge store
@@ -21,9 +21,9 @@ By itself, the enrichment tree doesn't include logic that would inform how its c
21
21
22
22
## Approaches for creating shapes
23
23
24
-
There are two ways to shape enriched content to that it can be projected into a knowledge store:
24
+
There are two ways to shape enriched content so that it can be projected into a knowledge store:
25
25
26
-
+ Use the [Shaper skill](cognitive-search-skill-shaper.md) to create nodes in an enrichment tree that are used expressly for projection. Most skills create new content. In contrast, a Shaper skill work with existing nodes, usually to consolidate multiple nodes into a single complex object. This is useful for tables, where you want the output of multiple nodes to be physically expressed as columns in the table.
26
+
+ Use the [Shaper skill](cognitive-search-skill-shaper.md) to create nodes in an enrichment tree that are used expressly for projection. Most skills create new content. In contrast, a Shaper skill works with existing nodes, usually to consolidate multiple nodes into a single complex object. This is useful for tables, where you want the output of multiple nodes to be physically expressed as columns in the table.
27
27
28
28
+ Use an inline shape within the projection definition itself.
29
29
@@ -111,11 +111,11 @@ Within a Shaper skill, an input can have a `sourceContext` element. This same pr
111
111
112
112
`sourceContext` is used to construct multi-level, nested objects in an enrichment pipeline. If the input is at a *different* context than the skill context, use the *sourceContext*. The *sourceContext* requires you to define a nested input with the specific element being addressed as the source.
113
113
114
-
In the example above, sentiment analysis and key phrases extraction was performed on text that was split into pages for more efficient analysis. Assuming you want the scores and phrases projected into a table, you'll now need to set the context to nested input that provides the score and phrase.
114
+
In the previous example, sentiment analysis and key phrases extraction was performed on text that was split into pages for more efficient analysis. Assuming you want the scores and phrases projected into a table, you'll now need to set the context to nested input that provides the score and phrase.
115
115
116
116
### Projecting a shape into multiple tables
117
117
118
-
With the `tableprojection` node defined in the `outputs`section above, you can slice parts of the `tableprojection` node into individual, related tables:
118
+
With the `tableprojection` node defined in the `outputs`in the previous section, you can slice parts of the `tableprojection` node into individual, related tables:
119
119
120
120
```json
121
121
"projections": [
@@ -145,8 +145,8 @@ With the `tableprojection` node defined in the `outputs` section above, you can
145
145
146
146
Inline shaping is the ability to form new shapes within the projection definition itself. Inline shaping has these characteristics:
147
147
148
-
+ The shape can be used only by the projection that contains it.
149
-
+ The shape can be identical to what a Shaper skill would produce.
148
+
+ The shape is used only by the projection that contains it.
149
+
+ The shape can be identical to what a Shaper skill produces.
150
150
151
151
An inline shape is created using `sourceContext` and `inputs`.
Copy file name to clipboardExpand all lines: articles/search/knowledge-store-projections-examples.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,20 @@ ms.service: azure-ai-search
10
10
ms.custom:
11
11
- ignite-2023
12
12
ms.topic: conceptual
13
-
ms.date: 12/10/2024
13
+
c
14
14
---
15
15
16
16
# Define projections in a knowledge store
17
17
18
-
[Projections](knowledge-store-projection-overview.md) are the component of a [knowledge store definition](knowledge-store-concept-intro.md) that determines where AI enriched content is stored in Azure Storage. Projections determine the type, quantity, and composition of the data structures containing your content.
18
+
[Projections](knowledge-store-projection-overview.md) are the component of a [knowledge store definition](knowledge-store-concept-intro.md) that determines how AI enriched content is stored in Azure Storage. Projections determine the type, quantity, and composition of the data structures containing your content.
19
19
20
20
In this article, learn the syntax for each type of projection:
Recall that projections are defined under the "knowledgeStore" property of a skillset.
26
+
Recall that projections are defined under the `knowledgeStore` property of a skillset.
27
27
28
28
```json
29
29
"knowledgeStore" : {
@@ -54,7 +54,7 @@ Except for file projections, which only accept binary images, the source must be
54
54
55
55
While a node might resolve to a single field, a more common representation is a reference to a complex shape. Complex shapes are created through a shaping methodology, either a [Shaper skill](cognitive-search-skill-shaper.md) or [an inline shaping definition](knowledge-store-projection-shape.md#inline-shape), but usually a Shaper skill. The fields or elements of the shape determine the fields in containers and tables.
56
56
57
-
Shaper skills are favored because it outputs JSON, where as most skills don't output valid JSON on their own. In many cases, the same data shape created by a Shaper skill can be used equally by both table and object projections.
57
+
Shaper skills are favored because it outputs JSON, whereas most skills don't output valid JSON on their own. In many cases, the same data shape created by a Shaper skill can be used equally by both table and object projections.
58
58
59
59
Given source input requirements, knowing how to [shape data](knowledge-store-projection-shape.md) becomes a practical requirement for projection definition, especially if you're working with tables.
60
60
@@ -67,13 +67,13 @@ To define a table projection, use the `tables` array in the projections property
67
67
| Property | Description |
68
68
|----------|-------------|
69
69
| tableName | Determines the name of a new table created in Azure Table Storage. |
70
-
| generatedKeyName | Column name for the key that uniquely identifies each row. The value is system-generated. If you omit this property, a column will be created automatically that uses the table name and "key" as the naming convention. |
70
+
| generatedKeyName | Column name for the key that uniquely identifies each row. The value is system-generated. If you omit this property, a column is created automatically that uses the table name and "key" as the naming convention. |
71
71
| source | A path to a node in an enrichment tree. The node should be a reference to a complex shape that determines which columns are created in the table.|
72
72
73
73
In table projections, "source" is usually the output of a [Shaper skill](cognitive-search-skill-shaper.md) that defines the shape of the table. Tables have rows and columns, and shaping is the mechanism by which rows and columns are specified. You can use a [Shaper skill or inline shapes](knowledge-store-projection-shape.md). The Shaper skill produces valid JSON, but the source could be the output from any skill, if valid JSON.
74
74
75
75
> [!NOTE]
76
-
> Table projections are subject to the [storage limits](/rest/api/storageservices/understanding-the-table-service-data-model) imposed by Azure Storage. The entity size cannot exceed 1 MB and a single property can be no bigger than 64 KB. These constraints make tables a good solution for storing a large number of small entities.
76
+
> Table projections are subject to the [storage limits](/rest/api/storageservices/understanding-the-table-service-data-model) imposed by Azure Storage. The entity size can't exceed 1 MB and a single property can be no bigger than 64 KB. These constraints make tables a good solution for storing a large number of small entities.
77
77
78
78
### Single table example
79
79
@@ -128,14 +128,14 @@ Columns are derived from the "source". The following data shape containing Hotel
128
128
129
129
A common pattern for table projections is to have multiple related tables, where system-generated partitionKey and rowKey columns are created to support cross-table relationships for all tables under the same projection group.
130
130
131
-
Creating multiple tables can be useful if you want control over how related data is aggregated. If enriched content has unrelated or independent components, for example the keywords extracted from a document might be unrelated from the entities recognized in the same document, you can split those fields out into adjacent tables.
131
+
Creating multiple tables can be useful if you want control over how related data is aggregated. If enriched content has unrelated or independent components, for example the keywords extracted from a document might be unrelated from the entities recognized in the same document, you can split out those fields into adjacent tables.
132
132
133
133
When you're projecting to multiple tables, the complete shape is projected into each table, unless a child node is the source of another table within the same group. Adding a projection with a source path that is a child of an existing projection results in the child node being sliced out of the parent node and projected into the new yet related table. This technique allows you to define a single node in a Shaper skill that can be the source for all of your projections.
134
134
135
135
The pattern for multiple tables consists of:
136
136
137
137
+ One table as the parent or main table
138
-
+Additional tables to contain slices of the enriched content
138
+
+Other tables to contain slices of the enriched content
139
139
140
140
For example, assume a Shaper skill outputs an "EnrichedShape" that contains hotel information, plus enriched content like key phrases, locations, and organizations. The main table would include fields that describe the hotel (ID, name, description, address, category). Key phrases would get the key phrase column. Entities would get the entity columns.
141
141
@@ -166,7 +166,7 @@ To define an object projection, use the `objects` array in the projections prope
166
166
| Property | Description |
167
167
|----------|-------------|
168
168
| storageContainer | Determines the name of a new container created in Azure Storage. |
169
-
| generatedKeyName | Column name for the key that uniquely identifies each row. The value is system-generated. If you omit this property, a column will be created automatically that uses the table name and "key" as the naming convention. |
169
+
| generatedKeyName | Column name for the key that uniquely identifies each row. The value is system-generated. If you omit this property, a column is created automatically that uses the table name and "key" as the naming convention. |
170
170
| source | A path to a node in an enrichment tree that is the root of the projection. The node is usually a reference to a complex data shape that determines blob structure.|
171
171
172
172
The following example projects individual hotel documents, one hotel document per blob, into a container called `hotels`.
@@ -193,7 +193,7 @@ The following example projects individual hotel documents, one hotel document pe
193
193
}
194
194
```
195
195
196
-
The source is the output of a Shaper skill, named `"objectprojection"`. Each blob will have a JSON representation of each field input.
196
+
The source is the output of a Shaper skill, named `"objectprojection"`. Each blob has a JSON representation of each field input.
197
197
198
198
```json
199
199
{
@@ -237,10 +237,10 @@ To define a file projection, use the `files` array in the projections property.
237
237
| Property | Description |
238
238
|----------|-------------|
239
239
| storageContainer | Determines the name of a new container created in Azure Storage. |
240
-
| generatedKeyName | Column name for the key that uniquely identifies each row. The value is system-generated. If you omit this property, a column will be created automatically that uses the table name and "key" as the naming convention. |
240
+
| generatedKeyName | Column name for the key that uniquely identifies each row. The value is system-generated. If you omit this property, a column is created automatically that uses the table name and "key" as the naming convention. |
241
241
| source | A path to a node in an enrichment tree that is the root of the projection. For images files, the source is always `/document/normalized_images/*`. File projections only act on the `normalized_images` collection. Neither indexers nor a skillset will pass through the original non-normalized image.|
242
242
243
-
The destination is always a blob container, with a folder prefix of the base64 encoded value of the document ID. If there are multiple images, they'll be placed together in the same folder. File projections can't share the same container as object projections and need to be projected into a different container.
243
+
The destination is always a blob container, with a folder prefix of the base64 encoded value of the document ID. If there are multiple images, they're placed together in the same folder. File projections can't share the same container as object projections and need to be projected into a different container.
244
244
245
245
The following example projects all normalized images extracted from the document node of an enriched document, into a container called `myImages`.
246
246
@@ -273,13 +273,13 @@ You can process projections by following these steps:
273
273
274
274
1. Use Azure portal to verify object creation in Azure Storage.
275
275
276
-
1. If you're projecting tables, [import them into Power BI](knowledge-store-connect-power-bi.md) for table manipulation and visualization. In most cases, Power BI will auto-discover the relationships among tables.
276
+
1. If you're projecting tables, [import them into Power BI](knowledge-store-connect-power-bi.md) for table manipulation and visualization. In most cases, Power BI autodiscovers the relationships among tables.
277
277
278
278
## Common issues
279
279
280
280
Omitting any of the following steps can result in unexpected outcomes. Check for the following conditions if your output doesn't look right.
281
281
282
-
+ String enrichments aren't shaped into valid JSON. When strings are enriched, for example `merged_content` enriched with key phrases, the enriched property is represented as a child of `merged_content` within the enrichment tree. The default representation isn't well-formed JSON. At projection time, make sure to transform the enrichment into a valid JSON object with a name and a value. Using a Shaper skill or defining inline shapes will help resolve this issue.
282
+
+ String enrichments aren't shaped into valid JSON. When strings are enriched, for example `merged_content` enriched with key phrases, the enriched property is represented as a child of `merged_content` within the enrichment tree. The default representation isn't well-formed JSON. At projection time, make sure to transform the enrichment into a valid JSON object with a name and a value. Using a Shaper skill or defining inline shapes help resolve this issue.
283
283
284
284
+ Omission of `/*` at the end of a source path. If the source of a projection is `/document/projectionShape/keyPhrases`, the key phrases array is projected as a single object/row. Instead, set the source path to `/document/projectionShape/keyPhrases/*` to yield a single row or object for each of the key phrases.
0 commit comments