From 68b94f3b84a0e5f092d00fe765ca61347d478776 Mon Sep 17 00:00:00 2001 From: James Nylen Date: Mon, 4 May 2020 09:32:43 +0000 Subject: [PATCH] Remove extra stop words This wasn't really working correctly - the stop word 'work' would leave instances of 'working' and 'works' in the index for example. --- lib/index.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/index.js b/lib/index.js index ec0bbcbb..a80415db 100755 --- a/lib/index.js +++ b/lib/index.js @@ -566,22 +566,6 @@ exports.buildSearchData = data => { // https://github.com/olivernn/lunr.js/issues/25#issuecomment-623267494 this.metadataWhitelist = ['position']; - // How to find more stop word candidates: - // cat site/build/assets/search-1588572080743.js | jq -r '.textData | .[] | .[]' - // paste the output into this tool: - // https://www.online-utility.org/text/analyzer.jsp - const extraStopWords = lunr.generateStopWordFilter( [ - 'career', - 'company', - 'employees', - 'job', - 'remote', - 'team', - 'work', - ] ); - lunr.Pipeline.registerFunction( extraStopWords, 'extraStopWords' ); - this.pipeline.after( lunr.stopWordFilter, extraStopWords ); - Object.keys( textData ).forEach( c => this.add( textData[ c ] ) ); } );