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
I recently added extended search (inspired by fzf). I'd love our thoughts 🙏
Why?
This form of advanced searching allows the user to fine-tune their results. It can be used to immediately exclude a large part of their search body before doing the final fuzzy matching. It's reminiscent of Unix-like terminal commands.
Search syntax
Fuse.js will work exactly as before, and if you give the option useExtendedSearch:true, you can use the following syntax in the search query:
Token
Match type
Description
jscript
fuzzy-match
Items that match jscript
'python
exact-match
Items that include python
!ruby
inverse-exact-match
Items that do not include ruby
^java
prefix-exact-match
Items that start with java
!^earlang
inverse-prefix-exact-match
Items that do not start with earlang
.js$
suffix-exact-match
Items that end with .js
!.go$
inverse-suffix-exact-match
Items that do not end with .go
White space acts as an AND operator, while a single pipe (|) character acts as an OR operator.
For example, this search query:
"^core go$ | js$ | py$ xy$"
is interpreted as the following logical expression:
Do we still need the previous implementation of tokenization (i.e, see #355)? With extended search, we have more useful form of fuzzy tokenization, where you could provide a pipe-delimited search query:
fuse.search("jcript | pthon | rby")
Feedback? Questions?
Please have a go at it 😄
The text was updated successfully, but these errors were encountered:
This looks great, and almost exactly what I was wanting when I filed #306!
I'm no longer directly affiliated with the project that was using Fuse that would have benefited from this, but I can probably whip up a pull request for them to switch to this and see how it actually works in real usage.
I recently added extended search (inspired by fzf). I'd love our thoughts 🙏
Why?
This form of advanced searching allows the user to fine-tune their results. It can be used to immediately exclude a large part of their search body before doing the final fuzzy matching. It's reminiscent of Unix-like terminal commands.
Search syntax
Fuse.js will work exactly as before, and if you give the option
useExtendedSearch:true
, you can use the following syntax in the search query:jscript
jscript
'python
python
!ruby
ruby
^java
java
!^earlang
earlang
.js$
.js
!.go$
.go
White space acts as an AND operator, while a single pipe (
|
) character acts as an OR operator.For example, this search query:
"^core go$ | js$ | py$ xy$"
is interpreted as the following logical expression:
Usage
Do we still need the previous implementation of tokenization (i.e, see #355)? With extended search, we have more useful form of fuzzy tokenization, where you could provide a pipe-delimited search query:
Feedback? Questions?
Please have a go at it 😄
The text was updated successfully, but these errors were encountered: