mirror of
https://github.com/remoteintech/remote-jobs
synced 2025-01-15 14:03:53 +00:00
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.
This commit is contained in:
parent
e983d65e01
commit
68b94f3b84
1 changed files with 0 additions and 16 deletions
16
lib/index.js
16
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 ] ) );
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in a new issue