From a3f5d445c08cd67141c28a2027b92d654f0f14c4 Mon Sep 17 00:00:00 2001 From: Seongjae Lee Date: Sat, 12 Sep 2015 01:04:11 -0700 Subject: [PATCH] Make lunr pipeline feature optionable If we have a note "Atom", and if the user types "a" or "at", then lunr pipeline ignores searching them because they are stop words. However, turning off this feature might not be a good idea when we have tons of body texts. So we turn it on as a default, but provide a way to turn it off as an option. --- lib/notational-velocity-view.coffee | 2 ++ lib/notational-velocity.coffee | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/lib/notational-velocity-view.coffee b/lib/notational-velocity-view.coffee index 1fdb678..036b3c9 100644 --- a/lib/notational-velocity-view.coffee +++ b/lib/notational-velocity-view.coffee @@ -28,6 +28,8 @@ class NotationalVelocityView extends SelectListView @populateList() if @documentsLoaded @docQuery.on "removed", (fileDetails) => @populateList() if @documentsLoaded + if !atom.config.get('nvatom.enableLunrPipeline') + @docQuery.searchIndex.pipeline.reset() isCursorProceeded: -> editor = @filterEditorView.model diff --git a/lib/notational-velocity.coffee b/lib/notational-velocity.coffee index c4fb388..6620b3c 100644 --- a/lib/notational-velocity.coffee +++ b/lib/notational-velocity.coffee @@ -9,6 +9,11 @@ module.exports = description: 'The directory to archive notes' type: 'string' default: path.join(process.env.ATOM_HOME, 'nvatom-notes') + enableLunrPipeline: + title: 'Enable Lunr Pipeline' + description: 'Lunr pipeline preprocesses query to make search faster. However, it will skip searching some of stop words such as "an" or "be".' + type: 'boolean' + default: true notationalVelocityView: null