Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findObjects function not available on index object. #104

Closed
Agusnez opened this issue Nov 5, 2022 · 5 comments
Closed

findObjects function not available on index object. #104

Agusnez opened this issue Nov 5, 2022 · 5 comments
Labels
question Further information is requested

Comments

@Agusnez
Copy link

Agusnez commented Nov 5, 2022

Hello,

I was performing a basic demo with:

<script setup>
const algoliaIndex = useAlgoliaInitIndex('test')
console.log(algoliaIndex.appId)
</script>

But the algoliaIndex object only has the search function available, not the findObjects operations that we are supposed to do on the Algolia documentation: https://www.algolia.com/doc/api-client/methods/search/

Is this an expected behaviour? Thanks!

@Agusnez Agusnez added the question Further information is requested label Nov 5, 2022
@Baroshem
Copy link
Collaborator

Baroshem commented Nov 5, 2022

Hey @Agusnez

I am not sure about this method. Do you mean that the TS is not suggesting it in the autocomplete or that this method is not available at all?

Maybe you need to load full algoliasearch (not the default lite version) to make it work.

https://algolia.nuxtjs.org/getting-started/configuration#lite

@Agusnez
Copy link
Author

Agusnez commented Nov 7, 2022

Hi @Baroshem,

Thank you very much for your help. The thing that is not working is that the method is not available at all:

Unhandled Promise Rejection: TypeError: index.findObject is not a function.

Let me look into the full algoliasearch, because it might be my case, since I'm using the useInitIndex moethod, not the useAlgoliaInitIndex like the example. (This is because I don't have it available in my installation)

I will post my updates.

@Baroshem
Copy link
Collaborator

Baroshem commented Nov 8, 2022

Hey @Agusnez

I think you have a typo in your method name (gindObject instead of findObjects).

Also, make sure to use useAlgoliaInitIndex at all times. The other method wont work.

@Agusnez
Copy link
Author

Agusnez commented Nov 9, 2022

Hi @Baroshem, I have good news about this.

I was using the previous version of the module @nuxt-modules/algolia. Removing it from the package.json and running npm i @nuxtjs/algolia fixed the issue. Now I see the useAlgoliaInitIndex function.

Thank you very much for your help!

@Agusnez Agusnez closed this as completed Nov 9, 2022
@Baroshem
Copy link
Collaborator

Baroshem commented Nov 9, 2022

@Agusnez I am glad that you have figured it out!

If you will have any questions, please let me know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants