Non-latin Search on NodeBB
-
Hello.
I have a NodeBB v.0.7.0 running in Ubuntu 14.04.2 LTS. Database is on Redis 2:2.8.4-2..
I wish to have a search on my russian forum and Redis seems to be not working with non-latin symbols well.
So i installed Elasticsearch 0.90.7 on my server and nodebb-plugin-search-elasticsearch on NodeBB in hope it will solve the problem.
The only changes i made in Elasticsearch configs are two stings :- network.bind_host: localhost
- cript.disable_dynamic: true
nodebb-plugin-search-elasricsearch settings you can see here
So the Dashboard indicates everything is OK, but when i'm pushing "Search" button the forum says "Oops ! Something went wrong !" and Elasticsearch stops.
./nodebb watch log
Elasticsearch logs spamming similar messages every minuteAny ideas i can get a workable russian search ?
-
I actually just stumbled across it.
https://github.com/rbeer/nodebb-plugin-search-elasticsearch/commit/19c572b9b40d5bc01cf99572ec5f9ac20f34e6fe
https://github.com/joe1chen/nodebb-plugin-search-elasticsearch/pull/3Seems to work for me. Wildcards aren't recognized, though. Don't know if that ever was the case.
The error is thrown by (line 18)
escapeSpecialChars = function(s) { return s.replace(/([\+\-&\|!\(\)\{\}\[\]\^"~\*\?:\\\ ])/g, function(match) { return '\\' + match; }); },
because the query string variable name in the payload seems to have changed from .query to .content. Thus
s.replace
fails, becauses
is of typeundefined
insted of the expectedstring
.