strapi-plugin-meilisearch icon indicating copy to clipboard operation
strapi-plugin-meilisearch copied to clipboard

Show popup to select field to index.

Open Grassper opened this issue 4 years ago • 6 comments

Hi, It could be nice to have a pop up to select a particular field in the document to index. Instead of indexing all fields of the document.

Grassper avatar Aug 26 '21 04:08 Grassper

That's something you can do when using Meilisearch client on your frontend.

PixeledCode avatar Aug 26 '21 13:08 PixeledCode

Hey @Grassper! Thanks for your suggestion :) I did indeed think of it when I was creating the plugin. I forgot to make an issue about it so many thanks :)

@PixeledCode what grassper is suggesting I think is when you click on the checkbox to index a Collection in MeiliSearch you are given the choice to chose which field are added.

I will come back to you as soon as we start implementing it and if meanwhile no one contributed by doing so.

Out of curiosity, do you have another plugin suggesting pop-ups? In order to inspire from them on how to implement it.

bidoubiwa avatar Aug 26 '21 13:08 bidoubiwa

related: #211

bidoubiwa avatar Sep 28 '21 12:09 bidoubiwa

this is also useful since by default user passwords (hashed, but still not good) will automatically be given to maili if a collection is connected to users, which is the case if you implement something like a author system

dadaphl avatar Oct 22 '21 13:10 dadaphl

@dadaphl i ran to this same issue so that i open this request and then i made an workaround by using strapi webhooks to send cleaned up collection to strapi server.

Grassper avatar Oct 22 '21 13:10 Grassper

Meanwhile this will be possible by adding a transformer to your collection so that you can change the data before sending it to MeiliSearch.

See #287

example in the restaurant collection.

  // api/restaurant/models/restaurant.js

module.exports = {
  transformEntryForMeiliSearch(entry) {
    const transformedEntry = entry
    // remove created by and updated by fields
    delete transformedEntry.created_by
    delete transformedEntry.updated_by
    return transformedEntry
  }
}

It will be available next release!

bidoubiwa avatar Oct 26 '21 17:10 bidoubiwa