docsearch icon indicating copy to clipboard operation
docsearch copied to clipboard

Hit result is shown empty even though it has data in lvl1 property of hit

Open hakankaraduman opened this issue 3 years ago • 14 comments

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

Screen Shot 2021-11-08 at 17 05 21 Screen Shot 2021-11-08 at 17 08 03

hakankaraduman avatar Nov 08 '21 14:11 hakankaraduman

Hey, what is the concerned index? Are you using the Algolia Crawler or the legacy platform?

shortcuts avatar Nov 08 '21 14:11 shortcuts

AppId: 58t665dnnu site: https://docs.controlplane.com/whatis

Are you using Docsearch scraper on your own @hakankaraduman?

bodinsamuel avatar Nov 09 '21 11:11 bodinsamuel

Yes, sometimes we initiate docsearch scraper on our own to speed up the process. @bodinsamuel @shortcuts

hakankaraduman avatar Nov 09 '21 11:11 hakankaraduman

I'm not sure if it's because of that, but some h2s are missing ids on your website (e.g. https://docs.controlplane.com/reference/gvc Overview), so it might create a record with an empty anchor

shortcuts avatar Nov 09 '21 12:11 shortcuts

I understand, thanks, we'll update the missing ids's and will try again.

hakankaraduman avatar Nov 09 '21 12:11 hakankaraduman

No problem, feel free to close if it was the issue

shortcuts avatar Nov 09 '21 12:11 shortcuts

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?

hakankaraduman avatar Nov 10 '21 11:11 hakankaraduman

Hey @hakankaraduman, I can still see empty ids 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

shortcuts avatar Nov 10 '21 11:11 shortcuts

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/

hakankaraduman avatar Nov 10 '21 12:11 hakankaraduman

Empty results' hit object that's given to hitComponent property shows it crawled lvl1 data btw.

hakankaraduman avatar Nov 11 '21 09:11 hakankaraduman

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

shortcuts avatar Nov 15 '21 11:11 shortcuts

Thank you for the update. Do you need anything else from us to help with your investigation?

hakankaraduman avatar Nov 20 '21 12:11 hakankaraduman

Hi, happy new year @shortcuts and @bodinsamuel ,

I was wondering if there is an investigation currently about this issue. Thanks

hakankaraduman avatar Jan 06 '22 11:01 hakankaraduman

Hi @shortcuts and @bodinsamuel , were you able to investigate the issue? Anything else you need from our side? Thanks!

enk21 avatar Feb 02 '22 02:02 enk21