docsearch
docsearch copied to clipboard
Hit result is shown empty even though it has data in lvl1 property of hit
Description
With the version 2, it was showing all results correctly with the default UI. After upgrading to v3, it shows some results empty. Even though it has lvl1 info in the found hit.
- DocSearch version: 3.0.0-alpha.41
See the images for the difference


Hey, what is the concerned index? Are you using the Algolia Crawler or the legacy platform?
AppId: 58t665dnnu site: https://docs.controlplane.com/whatis
Are you using Docsearch scraper on your own @hakankaraduman?
Yes, sometimes we initiate docsearch scraper on our own to speed up the process. @bodinsamuel @shortcuts
I'm not sure if it's because of that, but some h2
s are missing id
s on your website (e.g. https://docs.controlplane.com/reference/gvc Overview
), so it might create a record with an empty anchor
I understand, thanks, we'll update the missing ids's and will try again.
No problem, feel free to close if it was the issue
Hi @shortcuts , that wasn't the issue. Where can I find how you construct the "children" prop that's given to hitComponent prop. So I can use the same component but update the text as I like from the "hit" object I receive?
Hey @hakankaraduman, I can still see empty id
s on production, was it tested on a dev env? I'd also like to try solving this.
Where can I find how you construct the "children" prop that's given to hitComponent prop. So I can use the same component but update the text as I like from the "hit" object I receive?
You can find it here: https://github.com/algolia/docsearch/blob/next/packages/docsearch-react/src/Results.tsx#L112, but I believe this issue should be solved at the indexing level
Hi @shortcuts , You are right, I deployed the fix to prod and triggered the manual crawler.
I also published a public test for you check out the v3 implementation. https://cpln-docs-test.web.app/
Empty results' hit object that's given to hitComponent property shows it crawled lvl1 data btw.
The issue could come to the fact that two pages with different URLs have the same lvl0
(h1
), so our frontend grouping does not find the right parent: https://github.com/algolia/docsearch/blob/next/packages/docsearch-react/src/DocSearchModal.tsx#L219
Trying with an other lvl0
(h2
for example) seems to solve the issue 🤔
Update: it does not work for every pages, need investigation
Thank you for the update. Do you need anything else from us to help with your investigation?
Hi, happy new year @shortcuts and @bodinsamuel ,
I was wondering if there is an investigation currently about this issue. Thanks
Hi @shortcuts and @bodinsamuel , were you able to investigate the issue? Anything else you need from our side? Thanks!