diff --git a/lib/Thinker.js b/lib/Thinker.js index 1797ec4..c89329d 100644 --- a/lib/Thinker.js +++ b/lib/Thinker.js @@ -315,6 +315,9 @@ Thinker.prototype.find = function (params) { // Remove dashes without space in front expression = expression.replace(/([^\s]){1}-/, "$1"); + // Replace multiple spaces with singles + expression = expression.replace(/\s+/g, " "); + // Remove leading and trailing spaces from search query expression = expression.trim(" "); diff --git a/package.json b/package.json index 5676d0e..ef2353a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "thinker-fts", - "version": "1.1.4", + "version": "1.1.5", "description": "Pure Javascript/Node.js in-memory full text search engine.", "author": "Hexagon ", "contributors": [{