Open goliney opened 5 years ago
Characters that are not present in a search query get highlighted:
import FuzzySearch from 'fz-search'; // v1.0.0 const nodes = [ { value: 'primer' }, ]; const fuzzy = new FuzzySearch({ source: nodes, keys: 'value', }); const [result] = fuzzy.search('pre').map( item => fuzzy.highlight(item.value) ); console.log(result);
<strong class="highlight">prime</strong>r
primer
<strong class="highlight">pr</strong>im<strong class="highlight">e</strong>r
As you can see, symbols im aren't present in a search query, but they are still highlighted.
im
Is it possible to avoid highlighting of symbols that are not present in a search query?
Sorry for late reply. Gap filling is a feature for less tech savy that prefer word and word-part than bag of letters. However it's optional, set this to 0:
highlight_bridge_gap: 0, // default 2
Characters that are not present in a search query get highlighted:
Code
Actual result
primer
Expected result
primer
Problem
As you can see, symbols
im
aren't present in a search query, but they are still highlighted.Is it possible to avoid highlighting of symbols that are not present in a search query?