krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.77k stars 754 forks source link

How does it search and rank multiple terms in multiple fields #644

Closed MichaelRoger closed 1 year ago

MichaelRoger commented 2 years ago

hi,

i have got the following configuration:

`{ includeScore: true, includeMatches: true, minMatchCharLength: 3, findAllMatches: true, keys: [ 'persondata.basic.givenNameReal', 'persondata.basic.surnameReal', 'persondata.basic.mainTasks' ]

    }`

lets say i have got an document with the following data:

{persondata: {basic: { givenNameReal:'Michael', surnameReal:'Mustermann', mainTasks : 'handarbeiter' } } }

let's search for 'michael musermann' and it just finds a match in the column 'persondata.basic.givenNameReal'

:-(

shouldn't be a finding in multiple columns been ranked up?

krisk commented 2 years ago

If a single record contains a match in multiple keys, currently only the best score is used. For better or worse, the score is not a compound function of multiple matches.

I wavered with this in the past, whether compound scoring should be the default behavior or not. Curious to get people's thoughts on this.

MichaelRoger commented 2 years ago

i would definitly say it has to be compound. because i search the best matching entry and therefor it should find the most interessting match (also in multiple columns)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days