Skip to content

Commit 195488a

Browse files
committed
Raised acrolinx score
1 parent 91f837f commit 195488a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

articles/search/knowledge-store-projection-example-long.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Clone or download [azure-search-postman-samples](https://github.com/Azure-Sample
2525

2626
## Set up sample data
2727

28-
Sample documents aren't specifically included with the Projections collection, but the [AI enrichment demo data files](https://github.com/Azure-Samples/azure-search-sample-data/tree/master/ai-enrichment-mixed-media) from the [azure-search-sample-data repo](https://github.com/Azure-Samples/azure-search-sample-data) contain text and images, and will work with the projections described in this example.
28+
Sample documents aren't included with the Projections collection, but the [AI enrichment demo data files](https://github.com/Azure-Samples/azure-search-sample-data/tree/master/ai-enrichment-mixed-media) from the [azure-search-sample-data repo](https://github.com/Azure-Samples/azure-search-sample-data) contain text and images, and will work with the projections described in this example.
2929

3030
Create a blob container in Azure Storage and upload all 14 items.
3131

@@ -195,7 +195,7 @@ A [Shaper skill](cognitive-search-skill-shaper.md) is a utility for working with
195195

196196
In this example, the custom shape combines blob metadata and identified entities and key phrases. The custom shape is called `projectionShape` and is parented under `/document`.
197197

198-
One purpose of shaping is to ensure that all enrichment nodes are expressed in well-formed JSON, which is required for projecting into knowledge store. This is especially true when an enrichment tree contains nodes that are not well-formed JSON (for example, when an enrichment is parented to a primitive like a string).
198+
One purpose of shaping is to ensure that all enrichment nodes are expressed in well-formed JSON, which is required for projecting into knowledge store. This is especially true when an enrichment tree contains nodes that aren't well-formed JSON (for example, when an enrichment is parented to a primitive like a string).
199199

200200
Notice the last two nodes, `KeyPhrases` and `Entities`. These are wrapped into a valid JSON object with the `sourceContext`. This is required as `keyphrases` and `entities` are enrichments on primitives and need to be converted to valid JSON before they can be projected.
201201

@@ -266,7 +266,7 @@ Notice the last two nodes, `KeyPhrases` and `Entities`. These are wrapped into a
266266

267267
### Add Shapers to a skillset
268268

269-
The example skillset introduced at the start of this article did not include the Shaper skill, but Shaper skills belong in a skillset and are often placed towards the end.
269+
The example skillset introduced at the start of this article didn't include the Shaper skill, but Shaper skills belong in a skillset and are often placed towards the end.
270270

271271
Within a skillset, a Shaper skill might look like this:
272272

@@ -284,7 +284,7 @@ Within a skillset, a Shaper skill might look like this:
284284

285285
## Projecting to tables
286286

287-
Drawing on the examples above, there is a known quantity of enrichments and data shapes that can be referenced in table projections. In the tables projection below, three tables are defined by setting the `tableName`, `source` and `generatedKeyName` properties.
287+
Drawing on the examples above, there's a known quantity of enrichments and data shapes that can be referenced in table projections. In the tables projection below, three tables are defined by setting the `tableName`, `source` and `generatedKeyName` properties.
288288

289289
All three of these tables will be related through generated keys and by the shared parent `/document/projectionShape`.
290290

@@ -327,31 +327,31 @@ You can check projection definitions by following these steps:
327327

328328
1. After updating the skillset, run the indexer.
329329

330-
You now have a working projection with three tables. [Importing these tables into Power BI](knowledge-store-connect-power-bi.md) should result in Power BI auto-discovering the relationships.
330+
You now have a working projection with three tables. [Importing these tables into Power BI](knowledge-store-connect-power-bi.md) should result in Power BI discovering the relationships.
331331

332332
Before moving on to the next example, let's revisit aspects of the table projection to understand the mechanics of slicing and relating data.
333333

334334
### Slicing a table into multiple child tables
335335

336336
Slicing is a technique that subdivides a whole consolidated shape into constituent parts. The outcome consists of separate but related tables that you can work with individually.
337337

338-
In the example, `projectionShape` is the consolidated shape (or enrichment node). In the projection definition, `projectionShape` is sliced into additional tables, which enables you to pull out parts of the shape, `keyPhrases` and `Entities`. In Power BI, this is useful as multiple entities and keyPhrases are associated with each document, and you will get more insights if you can see entities and keyPhrases as categorized data.
338+
In the example, `projectionShape` is the consolidated shape (or enrichment node). In the projection definition, `projectionShape` is sliced into additional tables, which enables you to pull out parts of the shape, `keyPhrases` and `Entities`. In Power BI, this is useful as multiple entities and keyPhrases are associated with each document, and you'll get more insights if you can see entities and keyPhrases as categorized data.
339339

340340
Slicing implicitly generates a relationship between the parent and child tables, using the `generatedKeyName` in the parent table to create a column with the same name in the child table.
341341

342342
### Naming relationships
343343

344-
The `generatedKeyName` and `referenceKeyName` properties are used to relate data across tables or even across projection types. Each row in the child table has a property pointing back to the parent. The name of the column or property in the child is the `referenceKeyName` from the parent. When the `referenceKeyName` is not provided, the service defaults it to the `generatedKeyName` from the parent.
344+
The `generatedKeyName` and `referenceKeyName` properties are used to relate data across tables or even across projection types. Each row in the child table has a property pointing back to the parent. The name of the column or property in the child is the `referenceKeyName` from the parent. When the `referenceKeyName` isn't provided, the service defaults it to the `generatedKeyName` from the parent.
345345

346346
Power BI relies on these generated keys to discover relationships within the tables. If you need the column in the child table named differently, set the `referenceKeyName` property on the parent table. One example would be to set the `generatedKeyName` as ID on the tblDocument table and the `referenceKeyName` as DocumentID. This would result in the column in the tblEntities and tblKeyPhrases tables containing the document ID being named DocumentID.
347347

348348
## Projecting blob documents
349349

350-
Object projections are JSON representations of the enrichment tree that can be sourced from any node. In comparison with table projections, object projections are simpler to define and are used when projecting whole documents. Object projections are limited to a single projection in a container and cannot be sliced.
350+
Object projections are JSON representations of the enrichment tree that can be sourced from any node. In comparison with table projections, object projections are simpler to define and are used when projecting whole documents. Object projections are limited to a single projection in a container and can't be sliced.
351351

352352
To define an object projection, use the `objects` array in the projections property.
353353

354-
The source is the path to a node of the enrichment tree that is the root of the projection. Although it is not required, the node path is usually the output of a Shaper skill. This is because most skills do not output valid JSON objects on their own, which means that some form of shaping is necessary. In many cases, the same Shaper skill that creates a table projection can be used to generate an object projection. Alternatively, the source can also be set to a node with [an inline shaping](knowledge-store-projection-shape.md#inline-shape) to provide the structure.
354+
The source is the path to a node of the enrichment tree that is the root of the projection. Although it isn't required, the node path is usually the output of a Shaper skill. This is because most skills don't output valid JSON objects on their own, which means that some form of shaping is necessary. In many cases, the same Shaper skill that creates a table projection can be used to generate an object projection. Alternatively, the source can also be set to a node with [an inline shaping](knowledge-store-projection-shape.md#inline-shape) to provide the structure.
355355

356356
The destination is always a blob container.
357357

@@ -422,7 +422,7 @@ To define a file projection, use the `files` array in the projections property.
422422

423423
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.
424424

425-
The destination is always a blob container, with a folder prefix of the base64 encoded value of the document ID. File projections cannot share the same container as object projections and need to be projected into a different container.
425+
The destination is always a blob container, with a folder prefix of the base64 encoded value of the document ID. File projections can't share the same container as object projections and need to be projected into a different container.
426426

427427
The following example projects all normalized images extracted from the document node of an enriched document, into a container called `myImages`.
428428

@@ -586,13 +586,13 @@ From the consolidated crossProjection object, slice the object into multiple tab
586586
}
587587
```
588588

589-
Object projections require a container name for each projection. Object projections and file projections cannot share a container.
589+
Object projections require a container name for each projection. Object projections and file projections can't share a container.
590590

591591
### Relationships among table, object, and file projections
592592

593-
This example also highlights another feature of projections. By defining multiple types of projections within the same projection object, there is a relationship expressed within and across the different types (tables, objects, files). This allows you to start with a table row for a document and find all the OCR text for the images within that document in the object projection.
593+
This example also highlights another feature of projections. By defining multiple types of projections within the same projection object, there's a relationship expressed within and across the different types (tables, objects, files). This allows you to start with a table row for a document and find all the OCR text for the images within that document in the object projection.
594594

595-
If you do not want the data related, define the projections in different projection groups. For example, the following snippet will result in the tables being related, but without relationships between the tables and the object (OCR text) projections.
595+
If you don't want the data related, define the projections in different projection groups. For example, the following snippet will result in the tables being related, but without relationships between the tables and the object (OCR text) projections.
596596

597597
Projection groups are useful when you want to project the same data in different shapes for different needs. For example, a projection group for the Power BI dashboard, and another projection group for capturing data used to train a machine learning model wrapped in a custom skill.
598598

@@ -654,7 +654,7 @@ When building projections of different types, file and object projections are ge
654654

655655
## Next steps
656656

657-
The example in this article demonstrates common patterns on how to create projections. Now that you have a good understanding of the concepts, you are better equipped to build projections for your specific scenario.
657+
The example in this article demonstrates common patterns on how to create projections. Now that you have a good understanding of the concepts, you're better equipped to build projections for your specific scenario.
658658

659659
> [!div class="nextstepaction"]
660660
> [Configure caching for incremental enrichment](search-howto-incremental-index.md)

0 commit comments

Comments
 (0)