meilisearch / documentation

Meilisearch documentation
https://docs.meilisearch.com
MIT License
147 stars 241 forks source link

Add a way to add data to results #2963

Closed stratboy closed 1 month ago

stratboy commented 2 months ago

Hi, there's a thing It seems is not explained at all: how to change results, how to add data, especially when using mailisearch js on the frontend. I mean: toSearchableArray is to define which fields will be indexed. But I would need also to define which fields will be returned on search results, and to add some arbitrary data to them (example: the resource url, the resource thumbnail, etc..). And I mean, that data should be defined on the server side, and passed already formatted to the client side. This thing seems not to be explained anywhere.

guimachiavelli commented 2 months ago

Hello @stratboy—thanks for getting in touch.

Since you're using toSearchableArray, I believe you're experiencing issues integrating Laravel Scout with Meilisearch, correct? My understanding is that fields added by extending a Laravel model should be present in the returned documents by default. If that's not happening, you might have found an implementation bug.

Can you confirm this for me? Knowing where people are struggling helps us improve documentation for future users.

That said, this repository is focussed on improving the documentation itself and is not a good place to offer support for specific implementation questions. I'd recommend you to reach out to our support staff and the Meilisearch community on Discord.

guimachiavelli commented 1 month ago

I'm closing this issue since it seems to be more of a support request than indicative of a specific problem with the docs. Comments are still welcome, though, and do re-open if necessary.