Commit 3b1fe06
Merge #620
620: Create a custom _meilisearch_id field r=bidoubiwa a=bidoubiwa
#612
When indexing an entry to Meilisearch, the `id` field used to be transformed with a prepend of its collection name.
For example in a `restaurant` collection:
```json
{
"id": 1,
"name": "pizza mania"
}
```
Would become in Meilisearch:
```json
{
"id": "restaurant-1",
"name": "pizza mania"
}
```
With this PR, instead of overwriting the `id` field an additional field is added `_meilisearch_id`.
The entry in Meilisearch is thus transformed like this:
```json
{
"id": 1,
"name": "pizza mania",
"_meilisearch_id": "restaurant-1"
}
```
Co-authored-by: Pablo Aldana <[email protected]>File tree
3 files changed
+12
-5
lines changed- resources/entries-query
- server/services/meilisearch
3 files changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
254 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
| |||
285 | 289 | | |
286 | 290 | | |
287 | 291 | | |
288 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
289 | 295 | | |
290 | 296 | | |
291 | 297 | | |
| |||
0 commit comments