dimitrov-adrian / directus-extension-searchsync

Simple Directus 9 extension that sync content with remote search engine.
MIT License
116 stars 27 forks source link

Meilisearch deleteItems deletes the entire index #33

Open romajs opened 9 months ago

romajs commented 9 months ago

This line is wrong: https://github.com/dimitrov-adrian/directus-extension-searchsync/blob/main/lib/indexers/meilisearch.js#L47

Current:

await axios.delete(`${config.host}/indexes/${collection}`, axiosConfig);

It should be:

await axios.delete(`${config.host}/indexes/${collection}/documents`, axiosConfig);

Instead of deleting the index documents it's deleting the entire index. 😢