CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.22k stars 97 forks source link

Speical Symbols #639

Open HuangYiming0608 opened 1 week ago

HuangYiming0608 commented 1 week ago

In my website(In Chinese), I use some special symbols, such as C++. If my search key word is C++, there is nothing! But If I use C, I can find this page.`

Is it because of special symbols?


I use wrapper library astro-pagefind. The number of issue is #85

bglw commented 1 week ago

Hey @HuangYiming0608 👋

Currently Pagefind doesn't index or search special characters — but you should still be seeing a result. When indexing, C++ will be normalized to c. When searching, the intention is that searching for C++ should actually search for c, so the results should still line up.

It's possible that the search reformatting isn't being applied when searching in some languages, I'll look into that.

(It's also worth considering supporting more symbol searches in Pagefind in the future, but that needs more thought)

HuangYiming0608 commented 1 week ago

Hey @HuangYiming0608 👋

Currently Pagefind doesn't index or search special characters — but you should still be seeing a result. When indexing, C++ will be normalized to c. When searching, the intention is that searching for C++ should actually search for c, so the results should still line up.

It's possible that the search reformatting isn't being applied when searching in some languages, I'll look into that.

(It's also worth considering supporting more symbol searches in Pagefind in the future, but that needs more thought)

So if all the characters of the key word are sperical charaters, such as ~, will it no result?

bglw commented 1 week ago

In the current implementation, correct. Searching for a ~ alone wouldn't return results.