From 440c799c4ccade907bd5e49d0a8f6a90646bbbe3 Mon Sep 17 00:00:00 2001 From: Christopher Rogers Date: Wed, 16 Apr 2014 14:03:58 -0700 Subject: [PATCH] Removes lunr stemmer from search index pipeline Signed-off-by: Christopher Rogers --- source/javascripts/app/search.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/javascripts/app/search.js b/source/javascripts/app/search.js index 4edd487..e1fca62 100644 --- a/source/javascripts/app/search.js +++ b/source/javascripts/app/search.js @@ -3,12 +3,13 @@ var $global = $(global); var content, searchInfo; var highlightOpts = { element: 'span', className: 'search-highlight' }; - var index = lunr(function () { - this.ref('id'); - this.field('title', { boost: 10 }); - // this.field('tags', { boost: 100 }); - this.field('body'); - }); + + var index = new lunr.Index; + + index.ref('id'); + index.field('title', { boost: 10 }); + index.field('body'); + index.pipeline.add(lunr.trimmer, lunr.stopWordFilter); $(populate); $(bind); @@ -25,7 +26,6 @@ index.add({ id: title.prop('id'), title: title.text(), - // tags: tags, body: body.text() }); });