docs: documentation updates for v2.10.2 (#13500)
This commit is contained in:
@@ -14,28 +14,25 @@ The Index Module is experimental and still in development, so it is subject to c
|
||||
|
||||
## What is the Index Module?
|
||||
|
||||
The Index Module is a tool to perform highly performant queries across modules, for example, to filter linked modules.
|
||||
The Index Module is a tool to perform high-performance queries across modules, for example, to filter linked modules.
|
||||
|
||||
While modules share the same database by default, Medusa [isolates modules](../../modules/isolation/page.mdx) to allow using external data sources or different database types.
|
||||
|
||||
So, when you retrieve data across modules using Query, Medusa aggregates the data coming from different modules to create the end result. This approach limits your ability to filter data by linked modules. For example, you can't filter products (created in the Product Module) by their brand (created in the Brand Module).
|
||||
|
||||
The Index Module solves this problem by ingesting data into a central data store on application startup. The data store has a relational structure that enables efficiently filtering data ingested from different modules (and their data stores). So, when you retrieve data with the Index Module, you're retrieving it from the Index' data store, not the original data source.
|
||||
The Index Module solves this problem by ingesting data into a central data store on application startup. The data store has a relational structure that enables efficient filtering of data ingested from different modules (and their data stores). So, when you retrieve data with the Index Module, you're retrieving it from the Index Module's data store, not the original data source.
|
||||
|
||||

|
||||
|
||||
### Ingested Data Models
|
||||
|
||||
Currently, only the following core data models are ingested into Index when you install it:
|
||||
All core data models in Medusa are ingested, including `Product`, `Price`, `SalesChannel`, and more. You can also index custom data models if they are linked to an ingested data model. You'll learn more about this in the [Ingest Custom Data Models](#how-to-ingest-custom-data-models) section.
|
||||
|
||||
- `Product`
|
||||
- `ProductVariant`
|
||||
- `Price`
|
||||
- `SalesChannel`
|
||||
<Note>
|
||||
|
||||
Consequently, you can only index custom data models if they are linked to an ingested data model. You'll learn more about this in the [Ingest Custom Data Models](#how-to-ingest-custom-data-models) section.
|
||||
Prior to [Medusa v2.10.2](https://github.com/medusajs/medusa/releases/tag/v2.10.2), only the `Product`, `ProductVariant`, `Price`, and `SalesChannel` data models were ingested. Make sure to update to the latest version to ingest all core data models.
|
||||
|
||||
Future versions may add more data models to the list.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
@@ -67,7 +64,7 @@ Finally, run the migrations to create the necessary tables for the Index Module
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
The index module only ingests data when you start your Medusa server. So, to ingest the [currently supported data models](#ingested-data-models), start the Medusa application:
|
||||
The Index Module only ingests data when you start your Medusa server. So, to ingest the [currently supported data models](#ingested-data-models), start the Medusa application:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run dev
|
||||
@@ -181,7 +178,7 @@ Read-only links are not supported by the Index Module.
|
||||
For example, assuming you have a Brand Module with a Brand data model (as explained in the [Customizations](../../../customization/custom-features/module/page.mdx)), you can ingest it into the Index Module using the `filterable` property in its link definition to the Product data model:
|
||||
|
||||
export const filterableHighlights = [
|
||||
["12", "filterable", "Inject Brand by setting its filterable properties."]
|
||||
["12", "filterable", "Ingest Brand by setting its filterable properties."]
|
||||
]
|
||||
|
||||
```ts title="src/links/product-brand.ts" highlights={filterableHighlights}
|
||||
|
||||
Reference in New Issue
Block a user