Closed praveenweb closed 5 years ago
Or maybe have an algolia integration?
On Thu, Jul 25 2019 at 11:17 AM, Tirumarai Selvan < notifications@github.com > wrote:
The search should crawl through all the markdown files for content and give back the links to the pages of the content with possible highlighting of the searched word.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub ( https://github.com/hasura/gatsby-gitbook-starter/issues/6?email_source=notifications&email_token=AABAAWACSDNNIKW7EJAMF4LQBE45TA5CNFSM4IGXDSD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HBMPAJQ ) , or mute the thread ( https://github.com/notifications/unsubscribe-auth/AABAAWGDMRI2TR2F37UAJOLQBE45TANCNFSM4IGXDSDQ ).
On Line 19 of the config.js
file, you have:
"indexName": "",
What is an example of what needs to go here? I'm having trouble figuring it out from Algolia's docs.
Thanks in advance for any assistance (and for creating and maintaining this project).
Of course I figured it out right after posting this. For anyone in the future: you have to create the searchable index on Algolia's end first, then use the name of the index you created in your config.
I apologize for the spam, but I did enounter another issue that I'm sure has to do with my Algolia configuration, but I can't seem to figure it out.
I haven't modified anything in src/utils/algolia.js
but I'm thinking maybe I need to? Or perhaps I need to add searchable attributes on Algolia's end, but it says it can't find them when I add them. I also wonder if maybe I need to deploy this to have it work (rather than just locally).
@elijah-io You don’t need to modify any code to get the Algolia search working. If the configuration is set correctly, all you need to do is to do a ‘npm run build’ once with the correct environment variables set and indexing should happen automatically. Have you tried running that step or is the index you are trying to use is different?
I had to setup my own index first to get it working, otherwise I was getting a different error and the app wouldn't build at all (saying that index was null). But yes, I did run npm run build
with the correct environmental variables and that's how I hit that initial issue I worked through by creating the index on Algolia's end.
Is this where I am going wrong?
As you can see, this is the index I am targeting, but it isn't seeing any data come through the API. I haven't modified anything else other than point it to the right index.
@elijah-io did you close the issue because you were able to solve this? I'm having the same issue but probably I'm doing something wrong. How did you solve it?
Nevermind. I figured it out.
Basically you need to do npm run build
in order to set the index in algolia and then you can use it also locally. Might be cleared out in the readme, if I have time I'll make a pull request
@praveenweb I've added a small section to quickly explain the steps needed for running algolia the first time. You can find it here https://github.com/hasura/gatsby-gitbook-starter/pull/43
The search should crawl through all the markdown files for content and give back the links to the pages of the content with possible highlighting of the searched word.