Skip to content

Commit 55db95d

Browse files
Update code samples [skip ci]
1 parent 5d2e8a4 commit 55db95d

14 files changed

+86
-7
lines changed

snippets/samples/code_samples_analytics_event_bind_event_1.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
```bash cURL
44
curl \
5-
-X POST 'https://edge.meilisearch.com/events' \
5+
-X POST 'https://PROJECT_URL/events' \
66
-H 'Content-Type: application/json' \
77
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
8-
-H 'X-MS-USER-ID: MEILISEARCH_USER_ID' \
8+
-H 'X-MS-USER-ID: SEARCH_USER_ID' \
99
--data-binary '{
1010
"eventType": "click",
1111
"eventName": "Search Result Clicked",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<CodeGroup>
2+
3+
```bash cURL
4+
curl \
5+
-X POST 'https://PROJECT_URL/events' \
6+
-H 'Content-Type: application/json' \
7+
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
8+
--data-binary '{
9+
"eventType": "click",
10+
"userId": "SEARCH_USER_ID",
11+
"eventName": "Search Result Clicked",
12+
"indexUid": "products",
13+
"objectId": "0",
14+
"position": 0
15+
}'
16+
```
17+
</CodeGroup>

snippets/samples/code_samples_analytics_event_click_1.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
```bash cURL
44
curl \
5-
-X POST 'https://edge.meilisearch.com/events' \
5+
-X POST 'https://PROJECT_URL/events' \
66
-H 'Content-Type: application/json' \
77
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
88
--data-binary '{
99
"eventType": "click",
1010
"eventName": "Search Result Clicked",
1111
"indexUid": "products",
12+
"userId": "SEARCH_USER_ID",
13+
"queryUid": "019a01b7-a1c2-7782-a410-bb1274c81393",
1214
"objectId": "0",
15+
"objectName": "DOCUMENT_DESCRIPTION",
1316
"position": 0
1417
}'
1518
```

snippets/samples/code_samples_analytics_event_conversion_1.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
```bash cURL
44
curl \
5-
-X POST 'https://edge.meilisearch.com/events' \
5+
-X POST 'https://PROJECT_URL/events' \
66
-H 'Content-Type: application/json' \
77
-H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY'
88
--data-binary '{
99
"eventType": "conversion",
1010
"eventName": "Product Added To Cart",
1111
"indexUid": "products",
12+
"userId": "SEARCH_USER_ID",
1213
"objectId": "0",
14+
"objectName": "DOCUMENT_DESCRIPTION",
1315
"position": 0
1416
}'
1517
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<CodeGroup>
2+
3+
```bash cURL
4+
curl \
5+
-X POST 'MEILISEARCH_URL/indexes/INDEX_UID/compact'
6+
```
7+
8+
```python Python
9+
client.index('movies').compact()
10+
```
11+
12+
```java Java
13+
client.index("INDEX_NAME").compact();
14+
```
15+
</CodeGroup>

snippets/samples/code_samples_export_post_1.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ curl \
1313
}
1414
}'
1515
```
16+
17+
```java Java
18+
Map<String, ExportIndexFilter> indexes = new HashMap<>();
19+
indexes.put("*", ExportIndexFilter.builder().overrideSettings(true).build());
20+
ExportRequest request = ExportRequest.builder().url("TARGET_INSTANCE_URL").indexes(indexes).build();
21+
client.export(request);
22+
```
1623
</CodeGroup>

snippets/samples/code_samples_getting_started_add_documents.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ $client->index('movies')->addDocuments($movies);
7878
// <dependency>
7979
// <groupId>com.meilisearch.sdk</groupId>
8080
// <artifactId>meilisearch-java</artifactId>
81-
// <version>0.16.1</version>
81+
// <version>0.17.0</version>
8282
// <type>pom</type>
8383
// </dependency>
8484

8585
// For Gradle
8686
// Add the following line to the `dependencies` section of your `build.gradle`:
8787
//
88-
// implementation 'com.meilisearch.sdk:meilisearch-java:0.16.1'
88+
// implementation 'com.meilisearch.sdk:meilisearch-java:0.17.0'
8989

9090
// In your .java file:
9191
import com.meilisearch.sdk;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<CodeGroup>
2+
3+
```go Go
4+
client.Index("INDEX_UID").Compact();
5+
```
6+
</CodeGroup>

snippets/samples/code_samples_update_vector_store_settings_1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
```bash cURL
44
curl \
5-
-X PUT 'MEILISEARCH_URL/indexes/INDEX_UID/settings/vector-store' \
5+
-X PATCH 'MEILISEARCH_URL/indexes/INDEX_UID/settings/vector-store' \
66
-H 'Content-Type: application/json' \
77
--data-binary '"experimental"'
88
```

snippets/samples/code_samples_webhooks_delete_1.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ client.deleteWebhook(WEBHOOK_UUID)
1212
```go Go
1313
client.DeleteWebhook("WEBHOOK_UUID");
1414
```
15+
16+
```rust Rust
17+
client.delete_webhook("WEBHOOK_UUID").await.unwrap();
18+
```
1519
</CodeGroup>

0 commit comments

Comments
 (0)