You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So essentially an array with companies and I have added "stop words" in the array.
I have created my key array as follows:
'keys' => [
[
'name' => 'stopword.name',
'weight' => 1
],
[
'name' => 'company.name',
'weight' => 0.5
],
[
'name' => 'tags.name',
'weight' => 1
]
]
But when I search for the term "Startup" it does not matter how I weight my keys, the company STARTUPLIFERS is always the one with the lowest score. followed by my stop word that is a 100% match. Im using the other options for my query:
"tokenize" => true,
"matchAllTokens" => true,
"caseSensitive" => false,
"includeScore" => true,
"shouldSort" => true
It looks like this is a limitation perhaps in Fuse.js (Will try to replicate it in JS) as there is no way to force a "word boundary" search that would have helped solving this specific problem.
The text was updated successfully, but these errors were encountered:
I replicated it in Fuse.js, and it's the exact same behavior. You're correct in that it seems to have to do with exact substring matches not being given a good score.
However, this is a problem that needs to be solved on the Fuse.js side and I encourage you to open an issue there.
It also seems like you're new to GitHub (welcome!) so I'd encourage you to get a little bit familiar with Markdown to format your issues. Especially creating code blocks would be helpful, as your code examples were not easy to read. ❤️
Hi,
I have been playing around with Fuse for a few days now and I can't get weighted search to work. I have a needle array that looks like this:
Array
(
[1] => Array
(
[company] => Array
(
[name] => STARTUPLIFERS IN SWEDEN
[registrationid] => 55XXXX-XXXX
[id] => 1
)
),
[company] => Array
(
[name] => Google
[registrationid] => 55XXXX-XXXX
[id] => 1
),
[tags] => Array
(
[name] => Startup
)
)
......
[7992] => Array
(
[stopwords] => Array
(
[name] => Startup
)
)
...
So essentially an array with companies and I have added "stop words" in the array.
I have created my key array as follows:
'keys' => [
[
'name' => 'stopword.name',
'weight' => 1
],
[
'name' => 'company.name',
'weight' => 0.5
],
[
'name' => 'tags.name',
'weight' => 1
]
]
But when I search for the term "Startup" it does not matter how I weight my keys, the company STARTUPLIFERS is always the one with the lowest score. followed by my stop word that is a 100% match. Im using the other options for my query:
"tokenize" => true,
"matchAllTokens" => true,
"caseSensitive" => false,
"includeScore" => true,
"shouldSort" => true
It looks like this is a limitation perhaps in Fuse.js (Will try to replicate it in JS) as there is no way to force a "word boundary" search that would have helped solving this specific problem.
The text was updated successfully, but these errors were encountered: