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

Integrate Pagefind for better search #2524

Open
wottpal opened this issue Nov 9, 2023 · 2 comments
Open

Integrate Pagefind for better search #2524

wottpal opened this issue Nov 9, 2023 · 2 comments

Comments

@wottpal
Copy link

wottpal commented Nov 9, 2023

See: https://pagefind.app/

They just released v1 and it could give the Nextra search superpowers and removes complexity from its chore 🤔

@dimaMachina
Copy link
Collaborator

Looks awesome, also seems it can fix an issue of searching data from remote content and data fetched from getStaticProps since the content is indexed from the directory of static HTML files (already built and not from raw md/mdx)

@Aruelius
Copy link

Looks awesome, also seems it can fix an issue of searching data from remote content and data fetched from getStaticProps since the content is indexed from the directory of static HTML files (already built and not from raw md/mdx)

It seems not support Chinese or other specialized languages for now.

https://pagefind.app/docs/multilingual/

Currently when indexing, Pagefind does not support stemming for specialized languages, but does support segmentation for words not separated by whitespace.

Pagefind does not yet support segmentation of the search query, so searching in the browser requires that words in the search query are separated by whitespace.

In practice, this means that on a page tagged as a zh- language, 每个月都 will be indexed as the words 每个, , and .

When searching in the browser, searching for 每个, , or individually will work. Additionally, searching 每個 月 都 will return results containing each word in any order, and searching "每个 月 都" in quotes will match 每个月都 exactly.

Searching for 每个月都 will return zero results, as Pagefind is not able to segment it into words in the browser. Work to improve this is underway and will hopefully remove this limitation in the future.

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

3 participants