nuxt-modules / algolia

🔎 Algolia module for Nuxt
https://algolia.nuxtjs.org/
MIT License
191 stars 35 forks source link

Get object algolia #139

Closed daflav closed 1 year ago

daflav commented 1 year ago

Hello, how i can get object by id trough nuxt-algolia please ?

https://www.algolia.com/doc/api-reference/api-methods/get-objects/

Baroshem commented 1 year ago

Hey,

You can use the useAlgoliaInitIndex composable to initialize the index and then call getObjects from it :)

daflav commented 1 year ago

Hello @Baroshem thanks for you reply. Already tried that but i got error: getObjects its not a function

const algoliaIndex = useAlgoliaInitIndex('products') const test = algoliaIndex.getObjects('my id')

// getObjects its not a function

Baroshem commented 1 year ago

Apart from that, you also need to set the lite: false option in module configuration as this option is only available for full version of Algolia :)

Baroshem commented 1 year ago

Hey @daflav

Have you managed to make it work?