From 3ed041ca729ab92d32822ddd1bbc40d63425e644 Mon Sep 17 00:00:00 2001 From: Dave Rugh Date: Wed, 2 Apr 2014 12:16:48 -0700 Subject: [PATCH] Enable support for multiple fields --- src/bloodhound/tokenizers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bloodhound/tokenizers.js b/src/bloodhound/tokenizers.js index 24746c5f..bec67bee 100644 --- a/src/bloodhound/tokenizers.js +++ b/src/bloodhound/tokenizers.js @@ -21,7 +21,13 @@ var tokenizers = (function(root) { function getObjTokenizer(tokenizer) { return function setKey(key) { - return function tokenize(o) { return tokenizer(o[key]); }; + return function tokenize(o) { + var rtval = []; + _.each(tokenizer(key), function(k) { + if (o[k]) rtval = rtval.concat(tokenizer(o[k])); + }); + return rtval; + }; }; } })();