Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
8e693848
Commit
8e693848
authored
Jul 02, 2017
by
NGPixel
Committed by
Nicolas Giard
Jul 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Allow CJK + Arabic chars in search queries
parent
137fefef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
search.js
server/libs/search.js
+2
-1
No files found.
server/libs/search.js
View file @
8e693848
...
...
@@ -7,6 +7,7 @@ const _ = require('lodash')
const
searchIndex
=
require
(
'./search-index'
)
const
stopWord
=
require
(
'stopword'
)
const
streamToPromise
=
require
(
'stream-to-promise'
)
const
searchAllowedChars
=
new
RegExp
(
'[^a-z0-9'
+
appdata
.
regex
.
cjk
+
appdata
.
regex
.
arabic
+
' ]'
,
'g'
)
module
.
exports
=
{
...
...
@@ -160,7 +161,7 @@ module.exports = {
.
deburr
()
.
toLower
()
.
trim
()
.
replace
(
/
[^
a-z0-9
]
/g
,
' '
)
.
replace
(
searchAllowedChars
,
' '
)
.
value
()
let
arrTerms
=
_
.
chain
(
terms
)
.
split
(
' '
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment