give higher ranking to full words?
i have these items to search through
- I would like a SeaPass today
- Can I buy Air2Sea tickets
- i want to go to the sea
when I search "sea" the results are in this order
- Can I buy Air2Sea tickets
- I would like a SeaPass today
- i want to go to the sea
I would like to give full words that are in the query that match higher ranking is this possible?
here are my configurations
output_limit: 6,
output_map: 'alias',
source: this.items,
thresh_include: 8,
minimum_match: 1,
bonus_token_order: 10,
bonus_match_start: 10,
bonus_position_decay: 0,
highlight_bridge_gap: 2,
highlight_prefix: true,
thresh_relative_to_best: 0.5
So, it's something I haven't done in this library but it make sens so I can probably do it.
When a full word is match, the part that I call prefix will span the full target and the full query token.
So m=n=prefix.
I'll note for myself https://github.com/jeancroy/FuzzySearch/blob/master/src/score.js#L62 https://github.com/jeancroy/FuzzySearch/blob/master/src/score.js#L187
In the meantime increasing bonus_match_start or decreasing bonus_token_order may help.
(The token order bonus penalize word later in the sentence.)