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

Take into account url query params (url.search) into results #48

Open
devstgo opened this issue Jul 15, 2024 · 0 comments
Open

Take into account url query params (url.search) into results #48

devstgo opened this issue Jul 15, 2024 · 0 comments

Comments

@devstgo
Copy link

devstgo commented Jul 15, 2024

Description

Query params are not used when SearchBar and SearchPage adapt the url from Typesense server response to docusaurus component.

Steps to reproduce

Scrap a website with some url with query params
Do a search in docusaurus
Check that response from typesense server return the query param in the response
Inspect the docusaurus href link and verify that link skips query params.

Expected Behavior

The href field has to take into account the query params

Actual Behavior

The actual code only has into account pathname and hash.

docusaurus-theme-search-typesense/src/theme/SearchPage/index.tsx line 284 concat parsedURL.search:

            url: isRegexpStringMatch(externalUrlRegex, parsedURL.href)
              ? parsedURL.href
              : parsedURL.pathname + parsedURL.search +  parsedURL.hash,

In the same way, we had to do the same modification into docusaurus-theme-search-typesense/src/theme/SearchBar/index.tsx at line 193:

url: withBaseUrl(`${url.pathname}${url.search}${url.hash}`),
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

1 participant