Replace any spaces with regex '.*' so multi-word search works on similar strings.
authorBen Thompson <ben@xtuple.com>
Thu, 22 May 2014 19:07:19 +0000 (15:07 -0400)
committerBen Thompson <ben@xtuple.com>
Thu, 22 May 2014 19:07:19 +0000 (15:07 -0400)
node-datasource/lib/query/freetext_query.js

index da8bff7..29a88f2 100644 (file)
@@ -45,7 +45,8 @@ noarg:true, regexp:true, undef:true, strict:true, trailing:true, white:true */
           parameters : [{
             attribute: _.pluck(columns, 'name'),
             operator: 'MATCHES',
-            value: that.query.q
+            /* Replace any spaces with regex '.*' so multi-word search works on similar strings. */
+            value: that.query.q.replace(' ', '.*')
           }]
         }, _.omit(this.query, 'q'));