Skip to content

Commit e4932f6

Browse files
committed
docs: fix filters in meilisearch and algolia guides
1 parent beb91d8 commit e4932f6

File tree

4 files changed

+72
-28
lines changed

4 files changed

+72
-28
lines changed

www/apps/book/public/llms-full.txt

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24310,7 +24310,7 @@ While this is the recommended way to create a Medusa application, you can altern
2431024310

2431124311
### Prerequisites
2431224312

24313-
- [Node.js v20+](https://nodejs.org/en/download)
24313+
- [Node.js v20+ (LTS versions)](https://nodejs.org/en/download)
2431424314
- [Git CLI tool](https://git-scm.com/downloads)
2431524315
- [PostgreSQL](https://www.postgresql.org/download/)
2431624316

@@ -44095,6 +44095,8 @@ Learn more about the Caching Module in the [Caching Module guide](https://docs.m
4409544095

4409644096
In this guide, you'll learn about the Caching Module and its providers.
4409744097

44098+
Refer to the [Medusa Cache Cloud](https://docs.medusajs.com/cloud/cache/index.html.md) guide for setting up the Caching Module in Cloud.
44099+
4409844100
The Caching Module is available starting [Medusa v2.11.0](https://github.com/medusajs/medusa/releases/tag/v2.11.0). It replaces the deprecated [Cache Module](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/infrastructure-modules/cache/index.html.md).
4409944101

4410044102
## What is the Caching Module?
@@ -44117,13 +44119,11 @@ If you're using the Cache Module in your application, refer to the [migrate to t
4411744119

4411844120
## Install the Caching Module
4411944121

44120-
The Caching Module is installed by default in your application. To use it, enable the caching feature flag and register the module in your `medusa-config.ts` file.
44121-
44122-
{/* <Note title="Cloud user?">
44122+
### Prerequisites
4412344123

44124-
Caching features are enabled by default for Cloud users. Learn more in the [Medusa Cache](!cloud!/cache) guide.
44124+
- [Redis installed and Redis server running](https://redis.io/docs/getting-started/installation/)
4412544125

44126-
</Note> */}
44126+
The Caching Module is installed by default in your application. To use it, enable the caching feature flag and register the module in your `medusa-config.ts` file.
4412744127

4412844128
### 1. Enable Caching Feature Flag
4412944129

@@ -90318,9 +90318,14 @@ You can now create the workflow that syncs the products to Algolia.
9031890318
To create the workflow, create the file `src/workflows/sync-products.ts` with the following content:
9031990319

9032090320
```ts title="src/workflows/sync-products.ts"
90321-
import { createWorkflow, WorkflowResponse } from "@medusajs/framework/workflows-sdk"
90321+
import {
90322+
createWorkflow,
90323+
transform,
90324+
WorkflowResponse
90325+
} from "@medusajs/framework/workflows-sdk"
9032290326
import { useQueryGraphStep } from "@medusajs/medusa/core-flows"
9032390327
import { syncProductsStep, SyncProductsStepInput } from "./steps/sync-products"
90328+
import { ProductStatus } from "@medusajs/framework/utils"
9032490329

9032590330
type SyncProductsWorkflowInput = {
9032690331
filters?: Record<string, unknown>
@@ -90331,6 +90336,14 @@ type SyncProductsWorkflowInput = {
9033190336
export const syncProductsWorkflow = createWorkflow(
9033290337
"sync-products",
9033390338
({ filters, limit, offset }: SyncProductsWorkflowInput) => {
90339+
const productFilters = transform({
90340+
filters
90341+
}, (data) => {
90342+
return {
90343+
status: ProductStatus.PUBLISHED,
90344+
...data.filters
90345+
}
90346+
})
9033490347
const { data, metadata } = useQueryGraphStep({
9033590348
entity: "product",
9033690349
fields: [
@@ -90349,10 +90362,7 @@ export const syncProductsWorkflow = createWorkflow(
9034990362
take: limit,
9035090363
skip: offset,
9035190364
},
90352-
filters: {
90353-
status: "published",
90354-
...filters,
90355-
},
90365+
filters: productFilters,
9035690366
})
9035790367

9035890368
syncProductsStep({
@@ -90656,6 +90666,7 @@ export default async function handleProductEvents({
9065690666
input: {
9065790667
filters: {
9065890668
id: data.id,
90669+
status: "published",
9065990670
},
9066090671
},
9066190672
})
@@ -98171,9 +98182,14 @@ You can now create the workflow that syncs products to Meilisearch.
9817198182
To create the workflow, create the file `src/workflows/sync-products.ts` with the following content:
9817298183

9817398184
```ts title="src/workflows/sync-products.ts"
98174-
import { createWorkflow, WorkflowResponse } from "@medusajs/framework/workflows-sdk"
98185+
import {
98186+
createWorkflow,
98187+
transform,
98188+
WorkflowResponse
98189+
} from "@medusajs/framework/workflows-sdk"
9817598190
import { useQueryGraphStep } from "@medusajs/medusa/core-flows"
9817698191
import { syncProductsStep, SyncProductsStepInput } from "./steps/sync-products"
98192+
import { ProductStatus } from "@medusajs/framework/utils"
9817798193

9817898194
type SyncProductsWorkflowInput = {
9817998195
filters?: Record<string, unknown>
@@ -98184,6 +98200,14 @@ type SyncProductsWorkflowInput = {
9818498200
export const syncProductsWorkflow = createWorkflow(
9818598201
"sync-products",
9818698202
({ filters, limit, offset }: SyncProductsWorkflowInput) => {
98203+
const productFilters = transform({
98204+
filters
98205+
}, (data) => {
98206+
return {
98207+
status: ProductStatus.PUBLISHED,
98208+
...data.filters
98209+
}
98210+
})
9818798211
const { data, metadata } = useQueryGraphStep({
9818898212
entity: "product",
9818998213
fields: [
@@ -98202,10 +98226,7 @@ export const syncProductsWorkflow = createWorkflow(
9820298226
take: limit,
9820398227
skip: offset,
9820498228
},
98205-
filters: {
98206-
status: "published",
98207-
...filters,
98208-
},
98229+
filters: productFilters,
9820998230
})
9821098231

9821198232
syncProductsStep({
@@ -98514,6 +98535,7 @@ export default async function handleProductEvents({
9851498535
input: {
9851598536
filters: {
9851698537
id: data.id,
98538+
status: "published",
9851798539
},
9851898540
},
9851998541
})

www/apps/resources/app/integrations/guides/algolia/page.mdx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,14 @@ You can now create the workflow that syncs the products to Algolia.
540540
To create the workflow, create the file `src/workflows/sync-products.ts` with the following content:
541541

542542
```ts title="src/workflows/sync-products.ts"
543-
import { createWorkflow, WorkflowResponse } from "@medusajs/framework/workflows-sdk"
543+
import {
544+
createWorkflow,
545+
transform,
546+
WorkflowResponse
547+
} from "@medusajs/framework/workflows-sdk"
544548
import { useQueryGraphStep } from "@medusajs/medusa/core-flows"
545549
import { syncProductsStep, SyncProductsStepInput } from "./steps/sync-products"
550+
import { ProductStatus } from "@medusajs/framework/utils"
546551

547552
type SyncProductsWorkflowInput = {
548553
filters?: Record<string, unknown>
@@ -553,6 +558,14 @@ type SyncProductsWorkflowInput = {
553558
export const syncProductsWorkflow = createWorkflow(
554559
"sync-products",
555560
({ filters, limit, offset }: SyncProductsWorkflowInput) => {
561+
const productFilters = transform({
562+
filters
563+
}, (data) => {
564+
return {
565+
status: ProductStatus.PUBLISHED,
566+
...data.filters
567+
}
568+
})
556569
const { data, metadata } = useQueryGraphStep({
557570
entity: "product",
558571
fields: [
@@ -571,10 +584,7 @@ export const syncProductsWorkflow = createWorkflow(
571584
take: limit,
572585
skip: offset,
573586
},
574-
filters: {
575-
status: "published",
576-
...filters,
577-
},
587+
filters: productFilters,
578588
})
579589

580590
syncProductsStep({
@@ -898,6 +908,7 @@ export default async function handleProductEvents({
898908
input: {
899909
filters: {
900910
id: data.id,
911+
status: "published",
901912
},
902913
},
903914
})

www/apps/resources/app/integrations/guides/meilisearch/page.mdx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,14 @@ You can now create the workflow that syncs products to Meilisearch.
520520
To create the workflow, create the file `src/workflows/sync-products.ts` with the following content:
521521

522522
```ts title="src/workflows/sync-products.ts"
523-
import { createWorkflow, WorkflowResponse } from "@medusajs/framework/workflows-sdk"
523+
import {
524+
createWorkflow,
525+
transform,
526+
WorkflowResponse
527+
} from "@medusajs/framework/workflows-sdk"
524528
import { useQueryGraphStep } from "@medusajs/medusa/core-flows"
525529
import { syncProductsStep, SyncProductsStepInput } from "./steps/sync-products"
530+
import { ProductStatus } from "@medusajs/framework/utils"
526531

527532
type SyncProductsWorkflowInput = {
528533
filters?: Record<string, unknown>
@@ -533,6 +538,14 @@ type SyncProductsWorkflowInput = {
533538
export const syncProductsWorkflow = createWorkflow(
534539
"sync-products",
535540
({ filters, limit, offset }: SyncProductsWorkflowInput) => {
541+
const productFilters = transform({
542+
filters
543+
}, (data) => {
544+
return {
545+
status: ProductStatus.PUBLISHED,
546+
...data.filters
547+
}
548+
})
536549
const { data, metadata } = useQueryGraphStep({
537550
entity: "product",
538551
fields: [
@@ -551,10 +564,7 @@ export const syncProductsWorkflow = createWorkflow(
551564
take: limit,
552565
skip: offset,
553566
},
554-
filters: {
555-
status: "published",
556-
...filters,
557-
},
567+
filters: productFilters,
558568
})
559569

560570
syncProductsStep({
@@ -883,6 +893,7 @@ export default async function handleProductEvents({
883893
input: {
884894
filters: {
885895
id: data.id,
896+
status: "published",
886897
},
887898
},
888899
})

www/apps/resources/generated/edit-dates.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6039,7 +6039,7 @@ export const generatedEditDates = {
60396039
"app/troubleshooting/workflow-errors/step-x-defined/page.mdx": "2025-03-21T07:09:02.741Z",
60406040
"app/troubleshooting/workflow-errors/when-then/page.mdx": "2025-03-21T08:35:45.145Z",
60416041
"app/how-to-tutorials/tutorials/abandoned-cart/page.mdx": "2025-06-26T11:45:57.112Z",
6042-
"app/integrations/guides/algolia/page.mdx": "2025-10-31T16:37:38.241Z",
6042+
"app/integrations/guides/algolia/page.mdx": "2025-11-20T15:20:38.696Z",
60436043
"app/integrations/guides/magento/page.mdx": "2025-10-09T11:30:09.533Z",
60446044
"app/js-sdk/auth/overview/page.mdx": "2025-03-28T08:05:32.622Z",
60456045
"app/how-to-tutorials/tutorials/loyalty-points/page.mdx": "2025-10-09T11:27:14.961Z",
@@ -6600,7 +6600,7 @@ export const generatedEditDates = {
66006600
"references/core_flows/Locking/Steps_Locking/variables/core_flows.Locking.Steps_Locking.acquireLockStepId/page.mdx": "2025-09-15T09:52:14.218Z",
66016601
"references/core_flows/Locking/Steps_Locking/variables/core_flows.Locking.Steps_Locking.releaseLockStepId/page.mdx": "2025-09-15T09:52:14.219Z",
66026602
"references/core_flows/Locking/core_flows.Locking.Steps_Locking/page.mdx": "2025-09-15T09:52:14.217Z",
6603-
"app/integrations/guides/meilisearch/page.mdx": "2025-10-31T16:38:53.945Z",
6603+
"app/integrations/guides/meilisearch/page.mdx": "2025-11-20T15:21:44.830Z",
66046604
"app/nextjs-starter/guides/storefront-returns/page.mdx": "2025-09-22T06:02:00.580Z",
66056605
"references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views/page.mdx": "2025-10-31T09:41:41.343Z",
66066606
"app/data-model-repository-reference/methods/create/page.mdx": "2025-10-28T16:02:14.959Z",

0 commit comments

Comments
 (0)