Skip to content

Commit f723bc5

Browse files
Update code samples [skip ci]
1 parent 18695aa commit f723bc5

6 files changed

+45
-0
lines changed

snippets/samples/code_samples_search_parameter_reference_media_1.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,19 @@ curl \
1717
}
1818
}'
1919
```
20+
21+
```go Go
22+
client.Index("INDEX_NAME").Search("", &meilisearch.SearchRequest{
23+
Hybrid: &meilisearch.SearchRequestHybrid{
24+
Embedder: "EMBEDDER_NAME",
25+
},
26+
Media: map[string]any{
27+
"FIELD_A": "VALUE_A",
28+
"FIELD_B": map[string]any{
29+
"FIELD_C": "VALUE_B",
30+
"FIELD_D": "VALUE_C",
31+
},
32+
},
33+
});
34+
```
2035
</CodeGroup>

snippets/samples/code_samples_webhooks_delete_1.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ curl \
88
```javascript JS
99
client.deleteWebhook(WEBHOOK_UUID)
1010
```
11+
12+
```go Go
13+
client.DeleteWebhook("WEBHOOK_UUID");
14+
```
1115
</CodeGroup>

snippets/samples/code_samples_webhooks_get_1.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ curl \
88
```javascript JS
99
client.getWebhooks()
1010
```
11+
12+
```go Go
13+
client.ListWebhooks();
14+
```
1115
</CodeGroup>

snippets/samples/code_samples_webhooks_get_single_1.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ curl \
88
```javascript JS
99
client.getWebhook(WEBHOOK_UUID)
1010
```
11+
12+
```go Go
13+
client.GetWebhook("WEBHOOK_UUID");
14+
```
1115
</CodeGroup>

snippets/samples/code_samples_webhooks_patch_1.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,12 @@ client.updateWebhook(WEBHOOK_UUID, {
1818
}
1919
})
2020
```
21+
22+
```go Go
23+
client.UpdateWebhook("WEBHOOK_UUID", &meilisearch.UpdateWebhookRequest{
24+
Header: map[string]string{
25+
"referer": ""
26+
},
27+
});
28+
```
2129
</CodeGroup>

snippets/samples/code_samples_webhooks_post_1.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@ client.createWebhook({
2222
}
2323
})
2424
```
25+
26+
```go Go
27+
client.AddWebhook(&meilisearch.AddWebhookRequest{
28+
URL: "WEBHOOK_TARGET_URL",
29+
Headers: map[string]string{
30+
"authorization": "SECURITY_KEY",
31+
"referer": "https://example.com"
32+
},
33+
});
34+
```
2535
</CodeGroup>

0 commit comments

Comments
 (0)