diff --git a/docs-site/content/27.0/api/search.md b/docs-site/content/27.0/api/search.md
index b9a0628a..410ed19f 100644
--- a/docs-site/content/27.0/api/search.md
+++ b/docs-site/content/27.0/api/search.md
@@ -716,7 +716,7 @@ Let's create a preset with name `listing_view`.
```js
await client.presets().upsert("listing_view", {
value: {
- searches: [{ collection: "products", q: "*", sort_by: "popularity" }],
+ collection: "products", q: "*", sort_by: "popularity",
},
});
```
@@ -727,9 +727,7 @@ Let's create a preset with name `listing_view`.
```dart
await client.presets.upsert('listing_view', {
'value': {
- 'searches': [
- {'collection': 'products', 'q': '*','sort_by': 'popularity'}
- ]
+ 'collection': 'products', 'q': '*','sort_by': 'popularity'
}
});
```
@@ -741,11 +739,10 @@ Let's create a preset with name `listing_view`.
curl "http://localhost:8108/presets/listing_view" -X PUT \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
--d '{"value": {"searches":[{"collection":"products","q":"*", "sort_by": "popularity"}]}}'
+-d '{"value": {"collection":"products","q":"*", "sort_by": "popularity"}}'
```
-
You can refer to this preset configuration during a search operation.
@@ -776,37 +773,30 @@ curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -X POST \
-You can use the preset configuration for a `GET .../search` end-point as well.
-
-The only requirement is that for
-`GET .../search`, the stored preset value should be a simple dictionary of search configurations, like this.
-
-
-
+:::tip
+The `value` key in the preset configuration can also match the search parameters for Federated / Multi Search. For example:
-```dart
- await client.presets.upsert('listing_view', {
- 'value': {
- {
- 'collection': 'products',
- 'q': '*',
- 'sort_by': 'popularity',
- }
- }
- });
+```js
+ await client.presets().upsert("listing_view", {
+ value: {
+ searches: [
+ {
+ collection: "products",
+ q: "*",
+ sort_by: "popularity",
+ },
+ {
+ collection: "blog_posts",
+ q: "*",
+ sort_by: "published_at:desc",
+ }
+ ],
+ },
+ })
```
+:::
-
-
-
-```shell
-curl "http://localhost:8108/presets/listing_view" -X PUT \
--H "Content-Type: application/json" \
--H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
-{"value": {"collection":"products","q":"*", "sort_by": "popularity"}}'
-```
-
-
+It's generally recommended to use single-search presets for flexibility. You can then combine them in a multi-search request using the `preset` parameter.
:::tip
Explicit query parameters passed to the search end-point will override parameters stored in preset value.
diff --git a/docs-site/content/27.1/api/search.md b/docs-site/content/27.1/api/search.md
index 09a411c4..26ac6baf 100644
--- a/docs-site/content/27.1/api/search.md
+++ b/docs-site/content/27.1/api/search.md
@@ -716,7 +716,7 @@ Let's create a preset with name `listing_view`.
```js
await client.presets().upsert("listing_view", {
value: {
- searches: [{ collection: "products", q: "*", sort_by: "popularity" }],
+ collection: "products", q: "*", sort_by: "popularity",
},
});
```
@@ -727,9 +727,7 @@ Let's create a preset with name `listing_view`.
```dart
await client.presets.upsert('listing_view', {
'value': {
- 'searches': [
- {'collection': 'products', 'q': '*','sort_by': 'popularity'}
- ]
+ 'collection': 'products', 'q': '*','sort_by': 'popularity'
}
});
```
@@ -741,7 +739,7 @@ Let's create a preset with name `listing_view`.
curl "http://localhost:8108/presets/listing_view" -X PUT \
-H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
--d '{"value": {"searches":[{"collection":"products","q":"*", "sort_by": "popularity"}]}}'
+-d '{"value": {"collection":"products","q":"*", "sort_by": "popularity"}}'
```
@@ -776,38 +774,31 @@ curl -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -X POST \
-You can use the preset configuration for a `GET .../search` end-point as well.
-
-The only requirement is that for
-`GET .../search`, the stored preset value should be a simple dictionary of search configurations, like this.
-
-
-
+:::tip
+The `value` key in the preset configuration can also match the search parameters for Federated / Multi Search. For example:
-```dart
- await client.presets.upsert('listing_view', {
- 'value': {
- {
- 'collection': 'products',
- 'q': '*',
- 'sort_by': 'popularity',
- }
- }
- });
+```js
+ await client.presets().upsert("listing_view", {
+ value: {
+ searches: [
+ {
+ collection: "products",
+ q: "*",
+ sort_by: "popularity",
+ },
+ {
+ collection: "blog_posts",
+ q: "*",
+ sort_by: "published_at:desc",
+ }
+ ],
+ },
+ })
```
+:::
-
-
-
-```shell
-curl "http://localhost:8108/presets/listing_view" -X PUT \
--H "Content-Type: application/json" \
--H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '
-{"value": {"collection":"products","q":"*", "sort_by": "popularity"}}'
-```
-
-
+It's generally recommended to use single-search presets for flexibility. You can then combine them in a multi-search request using the `preset` parameter.
:::tip
Explicit query parameters passed to the search end-point will override parameters stored in preset value.
-:::
+:::
\ No newline at end of file