Wordrpress JS Error

Following the tutorial in installing InstantsearchJS, I am getting the following error. Any ideas on what I did wrong?

Do you have a Codesandbox https://codesandbox.io with you InstantSearch code in it that we can look at? You can find some templates that you can use to build an example of the issue here: https://github.com/algolia/create-instantsearch-app#previews

Hi @matthew.bond, I have not used codesandbox before but I have tried setting it up. I am getting the error below as well - https://codesandbox.io/s/algolia-demo-testing-7d007

Hi @jgacuca,

Thanks for following-up. Here is a codesandbax for Instantsearch JS with much of the basic boilerplate finished for a demo app:

What you can do is fork the sandbox to make a copy, then delete/replace code as needed to show your issue! We hope this helps

https://codesandbox.io/s/beautiful-rain-efszb - I forked and added my code, still no luck.

Hi @jgacuca,

I added the comment at the top of the code to get rid of the errors.

However, I don’t see any results. Can you check to make sure you have your app ID, search api key, and attributes in hits widget correctly.

Also , can you confirm that you have records in your Algolia index ‘WPDEMO’, or provide a search term that should produce results?

No luck,
is it that the index name is wrong? I created my own

See, screenshot attached. Records are included.

The indexName should be the same as the one you see on the dashboard: wp_demo (not WPDEMO).

I manually uploaded a file which it’s searching, but Algolia’s not searching the actual Wordpress files.

Hi @jgacuca,

Thanks for providing this detail.

If we understand the current situation, you have successfully indexed records to an Algolia index named wp_demo and it is now searchable as shown in this codesandbox (the result hits templates show without any text/data - likely bc they are not matched correctly with your actual attribute names). Is this understanding correct?

When you say “Algolia is not searching the actual Wordpress files”, could you clarify?

We would only expect the Algolia search to make queries to the Algolia index, not an actual WordPress website and files. We look forward to your reply.

Hi @ajay.david, The posts in the Wordpress site, Algolia is unable to pull the search. However, when I manually imported a JSON file for wp_demo, it was able to retrieve the search results. How do I retrieve the actual posts in search?

Hi @jgacuca, If I understand correctly, you have imdexed the posts from your WordPress website manually with a JSON file. now you are trying to connect WordPress to that Algolia index to make the WordPress search work correctly. Is that correct?

I would suggest using our Instantsearch to integrate the search on your WordPress website. You should be able to add them the instant search to your WordPress page like you would any other Javascript - either in the theme or as a plugin.

No. The manual index was another file, I tried using, which it worked. The Wordpress posts are not searching after setting up the Algolia Wordpress Plugin. I would like to do a screencast, as well as the Github files I setup, is that ok?

Hi @jgacuca, feel free to record the way you do it in a screencast. Please make sure the resolution is good enough so that we can actually read the code.

I have been making progress, the files were able to push. I have added the searchbox in the Wordpress file, but it doesn’t show. Trying to figure that out. See the images attached.



Hi @jgacuca, it is very difficult for us to see what is the real issue here. A screencast or, even better, a place where we could see your Wordpress instance online would be very helpful for us.