algolia / docsearch-configs

DocSearch - Configurations
https://docsearch.algolia.com/
MIT License
457 stars 1.13k forks source link

[capact] Empty search results for any query #4384

Closed pkosiec closed 3 years ago

pkosiec commented 3 years ago

Hi, The index for the https://capact.io site was added a few days ago by @shortcuts in this commit: https://github.com/algolia/docsearch-configs/commit/696a37e79af39f31501379196a796ae957293296. Thank you very much for that!

However, after configuring the search on the website, it turns out that there are no results returned. It's been more than 24 hours after adding the index, which means the site should be already crawled.

In the Algolia dashboard I can see analytics, which means the requests to Algolia are properly handled. There are no JS errors or failed requests in developer console for the website.

Could you please take a look if the crawler hasn't stumbled upon some crawling issue?

Links

Running local crawler

I tried to run the crawler locally using Docker image (as described here), and looks like it scrapes the site properly:

❯ docker run -it --env-file=/tmp/env -e "CONFIG=$(cat /tmp/docsearch.json | jq -r tostring)" algolia/docsearch-scraper
> DocSearch: https://capact.io/ 1 records)
> DocSearch: https://capact.io/docs/next/cli/commands/capact_typeinstance_get/ 8 records)
> DocSearch: https://capact.io/docs/next/cli/commands/capact_typeinstance_edit/ 9 records)
> DocSearch: https://capact.io/docs/next/cli/commands/capact_typeinstance_apply/ 10 records)
# (...)
> DocSearch: https://capact.io/docs/next/cli/commands/capact/ 24 records)
> DocSearch: https://capact.io/docs/next/architecture/engine-k8s-api/ 22 records)

Nb hits: 4065

Also, I can see indices now in the Algolia project I used for this test.

shortcuts commented 3 years ago

Hey @pkosiec,

Looking at your index in production, it seems that the DocSearch plugin wasn't enabled on your website when the last crawl (~25 hours ago) happened, which makes the contextualSearch unusable until next crawl (which should be in a few hours).

You can disable the contextualSearch option in the meantime, and after next crawl re-enable it!

pkosiec commented 3 years ago

Oh, okay, I didn't know that the website needs to have DocSearch turned on to have the site properly crawled with such configuration. I will wait a few hours then 🙂 If everything will be fine, then I will close the issue. Thank you, @shortcuts!

pkosiec commented 3 years ago

Hey @shortcuts, Still no results with the contextualSearch option... 🤔 Did the crawler successfully indexed the website?

BTW Yesterday when I disabled the option on my local machine then yes, I saw the search results. Obviously, they didn't look good because of versioned docs we're using, so that's why this the contextualSearch option is a must-have for us.

shortcuts commented 3 years ago

Hey @pkosiec,

I'm not sure why but it hasn't been queued yet 🤔 , this PR will force an indexing on your website, it should be done in the next 10 minutes: https://github.com/algolia/docsearch-configs/pull/4396

EDIT: it seems that there was an issue when deploying your config, it should now be crawled every 24 hours. EDIT2: Your index is up to date, you can now use the contextualSearch option

pkosiec commented 3 years ago

Thank you a lot, @shortcuts, for your help! Works well 👍