Hi! I have a question relating to curation. When u...
# community-help
d
Hi! I have a question relating to curation. When using the “Return Custom Metadata” option the data comes through in the response on the “metadata” property. Is there a way to access this data using the instantsearch adapter and react instantsearch components?
j
The metadata field is exposed via the
queryRuleCustomData
widget: https://www.algolia.com/doc/api-reference/widgets/query-rule-custom-data/js/
d
Excellent, thanks Jason!
👍 1
Is v7 of instantsearch required for this? I’m currently running v6 and the “items” array is empty when using both QueryRuleCustomData component and connectQueryRules. Using the network tab I can see the metadata is on the response.
To clarify I’m using v6 of React Instantsearch (rather than the plain js v4 library)
I’ve since tried in plain js using instantsearch v4 connectQueryRules connector and have the same problem. In this case also the metadata object is present on the response from typesense, just doesn’t seem to be passed through as items
j
It should be agnostic to the version of instantsearch. Could you try running the example app inside the integration test suite and see how it differs from your app
d
I tried running the test example but it failed because of some babel errors. Will try again tomorrow and see if I can get it running. I’ll let you know
I got the test app to work and tried to replicate it in my own code with no luck. Tried with react-instantsearch and standalone js version. Also tried using all the latest packages via cdn. The data comes through on the response but items array is always empty on the frontend. Gonna shelve it for now and try again another time! Thanks for the help 🙂
🤞 1
🤔 1
I noticed that this was added to a pre release version that isn’t available via cdn. Could that explain why I’m having no luck?
j
Prerelease versions should also be available via CDN, if you use that specific pre-release version in the URL
d
It works! thanks for the help
🙌 1