Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Results #1823

Closed
siduck opened this issue Mar 15, 2023 · 32 comments
Closed

Empty Results #1823

siduck opened this issue Mar 15, 2023 · 32 comments

Comments

@siduck
Copy link

siduck commented Mar 15, 2023

Hi there, I added docsearch to my site and it shows the auto-compeletion popup but i dont see any autocompletions or results at all

image

appId: "BOJS19CH35",
apiKey: "c74ee96af1dea95b6e189501983733f8",
indexName: "nvchad",
@shortcuts
Copy link
Member

shortcuts commented Mar 15, 2023

Hey! Looking at your Crawler, we did not managed to get any records in. Can you try restarting it?

Edit: the sitemap returns a 404, so the Crawler doesn't find any pages. Try adding an other URL to the startUrls, e.g. https://nvchad.com/#/docs/quickstart/install so it helps it discovering new links

@siduck
Copy link
Author

siduck commented Mar 15, 2023

ok restarted it
image

@siduck
Copy link
Author

siduck commented Mar 15, 2023

Do I need a sitemap.xml? docsearch docs didnt mention anything about it

@shortcuts
Copy link
Member

Do I need a sitemap.xml? docsearch docs didnt mention anything about it

Nope you don't, it's nice to have since it helps the Crawler finding new pages


I took a look at your Crawler and it seems to be configured for a Docusaurus website, but isn't one. I fixed the config, it should work better now :)

@siduck
Copy link
Author

siduck commented Mar 15, 2023

Thx! It does show the results now
image

but there are very few ( only of the home page )

clicking them points to a nonexistent id

image

@siduck
Copy link
Author

siduck commented Mar 15, 2023

Nope you don't, it's nice to have since it helps the Crawler finding new pages

So without it the crawler wouldnt find new pages?

@shortcuts
Copy link
Member

Nope you don't, it's nice to have since it helps the Crawler finding new pages

So without it the crawler wouldnt find new pages?

It helps with consistency, especially with client-side rendered websites. Here it seems that it doesn't manage to discover every pages of your website, so it would really help

@shortcuts
Copy link
Member

but there are very few ( only of the home page )

Does your website apply some redirects? For example, when we crawl this page https://nvchad.com/#/docs/quickstart/install, it redirects to https://nvchad.com/#/

@siduck
Copy link
Author

siduck commented Mar 15, 2023

but there are very few ( only of the home page )

Does your website apply some redirects? For example, when we crawl this page https://nvchad.com/#/docs/quickstart/install, it redirects to https://nvchad.com/#/

No

@siduck
Copy link
Author

siduck commented Mar 15, 2023

I got no idea why it redirects there, im using hashrouter ( in my solid-router settings ) , does that affect anything?

@siduck
Copy link
Author

siduck commented Mar 15, 2023

asked chatgpt 🤯

image

@shortcuts
Copy link
Member

I got no idea why it redirects there, im using hashrouter ( in my solid-router settings ) , does that affect anything?

I'd assume so, it seems that https://nvchad.com/#/docs/quickstart/install renders the home page, it's not a redirect actually my bad.

I can reproduce by going to the editor -> URL tester with https://nvchad.com/#/docs/quickstart/install -> and on the HTML section you'll see the homepage rendered

@shortcuts
Copy link
Member

asked chatgpt 🤯

HUGE ahaha

@siduck
Copy link
Author

siduck commented Mar 15, 2023

I got no idea why it redirects there, im using hashrouter ( in my solid-router settings ) , does that affect anything?

I'd assume so, it seems that https://nvchad.com/#/docs/quickstart/install renders the home page, it's not a redirect actually my bad.

I can reproduce by going to the editor -> URL tester with https://nvchad.com/#/docs/quickstart/install -> and on the HTML section you'll see the homepage rendered

oh what would be the solution to this then? I've to use hashrouter method in solid-router compulsory

@shortcuts
Copy link
Member

oh what would be the solution to this then? I've to use hashrouter method in solid-router compulsory

I've never implemented such routing sorry! I know we had user with similar cases, I guess the repo of the tools you use would have the answers

@siduck
Copy link
Author

siduck commented Mar 15, 2023

oh what would be the solution to this then? I've to use hashrouter method in solid-router compulsory

I've never implemented such routing sorry! I know we had user with similar cases, I guess the repo of the tools you use would have the answers

this could help #648

@shortcuts
Copy link
Member

shortcuts commented Mar 15, 2023

Ah yes for the rendered links, indeed! For the discovering of the pages, I'd say a sitemap would solve all problems

@siduck
Copy link
Author

siduck commented Mar 15, 2023

Ah yes for the rendered links, indeed! For the discovering of the pages, I'd say a sitemap would solve all problems

I tried a vite plugin to automatically generate it

it looks like this

image

is it normal?

@shortcuts
Copy link
Member

shortcuts commented Mar 15, 2023

I guess the plugin is not able to discover your urls too then :/ You should have a url block for each URL of your website, see https://www.algolia.com/sitemap.xml for example

@siduck
Copy link
Author

siduck commented Mar 15, 2023

I guess the plugin is not able to discover your urls too then :/ You should have a url block for each URL of your website, see https://www.algolia.com/sitemap.xml for example

ok i'll manually try first, do I include the hashes? Wouldnt that redirect to homepage too :(

image

@shortcuts
Copy link
Member

do I include the hashes? Wouldnt that redirect to homepage too :(

Yes, the sitemap should represent the final URL that you can access from a browser.

Note that this will only help the Crawler to properly discover URLs, but won't fix the render issue. Hash routing have a huge impact on SEO and discovery in general, I'd recommend to switch to an other history mode if that's possible for you

@siduck
Copy link
Author

siduck commented Mar 15, 2023

do I include the hashes? Wouldnt that redirect to homepage too :(

Yes, the sitemap should represent the final URL that you can access from a browser.

Note that this will only help the Crawler to properly discover URLs, but won't fix the render issue. Hash routing have a huge impact on SEO and discovery in general, I'd recommend to switch to an other history mode if that's possible for you

I wasnt using hash routing before, but i got those 404 errors whenever reloading a non home route. I didnt know other methods than hashrouting to fix it :( https://github.com/solidjs/solid-router

@siduck
Copy link
Author

siduck commented Mar 15, 2023

@shortcuts ok i stopped using hashrouter, now im using https://github.com/rafgraph/spa-github-pages , does the crawler work now?

@siduck
Copy link
Author

siduck commented Mar 15, 2023

@shortcuts
Copy link
Member

Trying from the URL tester in the editor, it returns 404 on those new URLs 🤔 Is it client-side redirects? See https://crawler.algolia.com/admin/crawlers/e120626d-7695-43f1-b9bf-b19726525e9b/monitoring/list?reason=http_not_found for more details

@siduck
Copy link
Author

siduck commented Mar 16, 2023

Trying from the URL tester in the editor, it returns 404 on those new URLs thinking Is it client-side redirects? See https://crawler.algolia.com/admin/crawlers/e120626d-7695-43f1-b9bf-b19726525e9b/monitoring/list?reason=http_not_found for more details

i was using the trick provided by the github-spa-pages repo, they use a 404.html and whenever a non home route loads, it probably loads the 404.html first and then redirects to the preferred route

@siduck
Copy link
Author

siduck commented Mar 16, 2023

@shortcuts so the crawler wont work with this method too? 😞

@siduck
Copy link
Author

siduck commented Mar 16, 2023

Just confiming, if thats the case then I cant use algolia and have to look for an alternative or write my own thing

@siduck siduck closed this as completed Mar 17, 2023
@shortcuts
Copy link
Member

Hey, sorry for the delay. I'll investigate internally if we can do something about the hash router problem

@siduck
Copy link
Author

siduck commented Mar 21, 2023

hi, you sure about this? crawling Non home routes redirects to the home page, idk how you'd work this out! Just tell me if supporting hashrouter isnt possible, Im on the way to write my own search functionality cuz of this but kept it on halt cuz your message, if algolia works then it'll save me lots of time!

@siduck siduck closed this as completed Mar 25, 2023
@siduck
Copy link
Author

siduck commented Mar 25, 2023

ok now the search function works! cuz my site is generated by solid-ssg! :D

@shortcuts
Copy link
Member

sick!! Congrats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants