Commit 8e693848 authored by NGPixel's avatar NGPixel Committed by Nicolas Giard

fix: Allow CJK + Arabic chars in search queries

parent 137fefef
...@@ -7,6 +7,7 @@ const _ = require('lodash') ...@@ -7,6 +7,7 @@ const _ = require('lodash')
const searchIndex = require('./search-index') const searchIndex = require('./search-index')
const stopWord = require('stopword') const stopWord = require('stopword')
const streamToPromise = require('stream-to-promise') const streamToPromise = require('stream-to-promise')
const searchAllowedChars = new RegExp('[^a-z0-9' + appdata.regex.cjk + appdata.regex.arabic + ' ]', 'g')
module.exports = { module.exports = {
...@@ -160,7 +161,7 @@ module.exports = { ...@@ -160,7 +161,7 @@ module.exports = {
.deburr() .deburr()
.toLower() .toLower()
.trim() .trim()
.replace(/[^a-z0-9 ]/g, ' ') .replace(searchAllowedChars, ' ')
.value() .value()
let arrTerms = _.chain(terms) let arrTerms = _.chain(terms)
.split(' ') .split(' ')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment