Extended search not working with AND at all
marceloverdijk opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Description of the bug
This is similar as #633 but which was closed.
With example from https://www.fusejs.io/demo.html and extended search enabled,
searching ^old scal
gives no results although I would have expected that Old Man's War from John Scalzi would have been returned.
Changing to ^old | scal
does give the result.
Also just old scal
does not give any results, but with old | scal
it does.
When disabling useExtendedSearch = false
then old scal
gives the result.
It seems when useExtendedSearch = true
is set an AND search is not working at all (compared to OR search with |
is working).
The Fuse.js version where this bug is happening.
6.6.2
Is this a regression?
- This is a regression bug
Which version did this behavior use to work in?
None
Steps To Reproduce
See description.
Expected behavior
AND to work with extend search enabled.
Screenshots
No response
Additional context
No response
Note that this works as well:
fuse.search({
$and: [
{ 'title': '^old' },
{ 'author.lastName: 'scal' },
]
})
but fuse.search('^old scal')
does not.
The spaces seem not to be parsed correctly.
Note the extended docs state:
White space acts as an AND operator, while a single pipe (
|
) character acts as an OR operator.
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