querying whole phrases, and not just the words in the phrase #739
Unanswered
designbymichael
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question for the more experienced Fuse users/developers. Like most, I struggle with tuning the search results, and it would be so much more reliable if there was a way to search either full phrases as a whole unit (e.g. "dark side of the moon", only results with "dark side of the moon" in the content/keywords matches, as well as any word in the phrase (which is what it's doing now for me, searching "dark side of the moon" would return pages with the word "dark" or "side" or "of" or "the" or "moon").
In the sample code that I've been using this sample code to implement Fuse, and within it all is the line
var result = fuse.search(searchQuery);
and it seems to be just rudimentary search with no sort of options for refining the search query.
I've tried things like:
var result = fuse.search("="+searchQuery);
to provide an exact match to the phrase as well as in the search term itself (searching with
=dark side of the moon
and'dark'side'of'the'moon
, but that didn't seem to produce any relevant results.What am I missing to take a phrase that someone searches with, and to return just pages that contain that phrase as-is (and not some combination of all the words scattered throughout the page)? I'd love to be able to outweigh pages with a combination of those words with pages that have the entire phrase present.
Beta Was this translation helpful? Give feedback.
All reactions