Skip to content

Search is failing on the main site #131

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

Closed
jonathanolson opened this issue Feb 14, 2025 · 6 comments
Closed

Search is failing on the main site #131

jonathanolson opened this issue Feb 14, 2025 · 6 comments
Assignees

Comments

@jonathanolson
Copy link
Contributor

I noticed there is separator: '[\s\-,:!=\[\]()"/]+|.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'` specified in mkdocs.yml for the search separator, I'm going to try removing it to see if there is an improvement.

Getting things like:

Invalid query: v – see https://bit.ly/2s3ChXG

index.ts:169 TypeError: Cannot read properties of undefined (reading '0')
    at index.ts:121:22
    at Array.map (<anonymous>)
    at q (index.ts:91:17)
    at oe (index.ts:59:10)
    at index.ts:267:26
    at Array.reduce (<anonymous>)
    at H.search (index.ts:230:8)
    at index.ts:163:23
    at Generator.next (<anonymous>)
    at search.6ce7567c.min.js:1:1108
@jonathanolson
Copy link
Contributor Author

https://github.com/squidfunk/mkdocs-material/blob/master/docs/contributing/reporting-a-bug.md for reporting a bug.

Upgrading mkdocs-material doesn't fix it. Removing customizations doesn't fix it. No similar bugs found online.

Very easily reproducible by opening console and typing out "Vector2" (it will error for each keypress).

My attempts to create a minimal reproduction aren't working.

@brettfiedler could you look into potentially submitting a bug for this, or seeing if there is a good fix or workaround?

@jonathanolson jonathanolson removed their assignment Feb 15, 2025
@brettfiedler
Copy link
Contributor

I think support for search is out - they are currently looking to revamp how it works entirely and away from the lunr.js MkDocs default implementation. See bottom comments in squidfunk/mkdocs-material#6307

On that note, there are a few other options in the search plugin to play with that I'll give a try: https://www.mkdocs.org/user-guide/configuration/#search

brettfiedler added a commit that referenced this issue Feb 19, 2025
@brettfiedler
Copy link
Contributor

brettfiedler commented Feb 19, 2025

Note: most of the search plugin parameters for mkdocs don't work here. Restricted to: https://squidfunk.github.io/mkdocs-material/plugins/search/

That being said, I adjusted the separator and tried removing search.share and had it working locally. I was able to search vector2 and retrieve results. It still doesn't always like to retrieve results after only 1 or 2 characters, but I think it's known to not parse that well, especially with such a large site.

Will see how it deploys.

@brettfiedler
Copy link
Contributor

Seems okay

Image

@jonathanolson, can you give it a quick look on your side?

@jonathanolson
Copy link
Contributor Author

Working so much better!

On tests, there are some things that are less than ideal (Vector2 is the 5th hit for the search "Vector2"). Is that something we want to try to improve (or could)?

I think the current setup is very acceptable, feel free to close if you'd like (I'm bumping priority to low)

@jonathanolson jonathanolson added priority:4-low and removed bug Something isn't working priority:1-top labels Feb 20, 2025
@brettfiedler
Copy link
Contributor

Closing. Will investigate search improvements when mkdocs material updates the plugin.

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

No branches or pull requests

2 participants