Cannot disable stemmer and search for exact word
See original GitHub issueThanks for this lunr.js lib which is great.
I would like to find exact matching word: For example:
When searching “implements”, I want only “implements” When searching “implemented”, I want only “implemented” When searching “implementation”, I want only “implementation”
Is that possible ?
I have tried disable the stemmer like this:
var index = lunr(function(){
this.ref('headingid')
this.field('headingname')
this.field('text')
this.metadataWhitelist = ['position']
data.forEach(function(item) {
this.add(item)
}, this);
this.pipeline.remove(lunr.stemmer);
this.pipeline.remove(lunr.stopWordFilter)
})
But no effect.
What would be the could config ?
Thanks a lot
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Disable stop words and stemming for phrases searches when ...
Disable stop words and stemming for phrases searches when using query_string · Create an extra field that has exact text · Run two...
Read more >Searching exact word matches should not ignore "common ...
Bug JRASERVER-36719 - Cannot find exact phrase when searching text field. ... The only workaround we have for this at the moment is...
Read more >have global search support exact matching (disabling ...
You are correct; we have no way to disable the porter stemming algorithm. ... Unfortunately, this would break phrase searching, so it's not...
Read more >Understanding and Using Stemmed Searches - Documentation
When stemmed search is enabled, the search matches the exact term, ... you can enable and disable the use of stemming on a...
Read more >How can i enforce whole word matching only (disable partial ...
xml distributed with Apache Solr Search Integration to enforce simple whole word matching ? If you can't support this request here I'd ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you have an example, putting together a reproduction on something like jsfiddle makes it a lot easier to understand the problem you are having.
If you want to completely disable the stemmer you must remove it from both the indexing pipeline and the search pipeline, this should work:
There is more documentation on the builder object and the different properties/methods that are available.
@ToLuSt thanks. I’m going to close this one out, @fzingg feel free to comment and I’ll re-open to look further into your original question.