mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
Try to fix CJK search
This commit is contained in:
+4
-1
@@ -12,7 +12,10 @@ import siteConfig from '../../config/site.config'
|
|||||||
* @returns Sanitised query string which replaces non-alphanumeric characters with ' '
|
* @returns Sanitised query string which replaces non-alphanumeric characters with ' '
|
||||||
*/
|
*/
|
||||||
function sanitiseQuery(query: string): string {
|
function sanitiseQuery(query: string): string {
|
||||||
const sanitisedQuery = query.replace(/[^a-zA-Z0-9]/g, ' ')
|
/** const sanitisedQuery = query.replace(/[^a-zA-Z0-9]/g, ' ')
|
||||||
|
* Actually this will cause problems with CJK only query words as it will remove every character.
|
||||||
|
* After removing it, CJK search will be much improved.
|
||||||
|
*/
|
||||||
return encodeURIComponent(sanitisedQuery)
|
return encodeURIComponent(sanitisedQuery)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user