Questions tagged [fuse.js]

anything related to the usage of the fuse.js javascript fuzzy-search library

fuse.js is a javascript lightweight fuzzy-search library

see fuse.js site for more info

56 questions
11
votes
2 answers

Fuse.js : retrieve records which exactly match a multiple word search

Using Fuse.js I'm trying to make a "multiple word" search in a JS object to get the records which contain exactly each word looked for. My data structure is the following (from fuse.js): [{ title: "The Lost Symbol", author: { …
Sebastien D
  • 4,369
  • 4
  • 18
  • 46
7
votes
1 answer

Fuse.js search in array of strings

I was trying to implement fuse.js to my app where I have array of strings without any key. ['Kelly', 'Creed', 'Stanley', 'Oscar', 'Michael', 'Jim', 'Darryl', 'Phyllis', 'Pam', 'Dwight', 'Angela', 'Andy', 'William', 'Ryan', 'Toby', 'Bob'] When I…
Lukáš Václavek
  • 442
  • 1
  • 6
  • 12
6
votes
0 answers

Matches/indices returns entire string

Using http://fusejs.io/ In just about all situations, I'm finding that the 'indices returned contain pretty much the entire string. For a very simple example, if you go to fusejs.io, and change the first object (in 'step 1' on the left) to { …
jameslol
  • 1,829
  • 16
  • 18
6
votes
1 answer

Fuse.js : How to return an exact match when there are two words to search for?

Here's what I'm trying to accomplish. Old War shouldn't match, but it does. -> It's not what I'm looking for, there must be an exact match, even though there are two words. Old Man is a yes, but Old War is a no. Man's War should match. It does at…
salep
  • 1,332
  • 9
  • 44
  • 93
6
votes
2 answers

Why does Webpack fail to find a module when the TypeScript compiler doesn't?

I'm trying to use Fuse in my TypeScript applications. I'm importing the module typings with import * as fuselib from 'fuse.js';. This compiles fine with tsc. The problem I'm running into is when I build the project using webpack --config…
onetwothree
  • 672
  • 1
  • 10
  • 20
5
votes
1 answer

use fuse.js in Angular 2 application (typescript)

I tried to import fuse.js in a angular2 app, but I get an exception (Fuse is not defined). I also check definitions file (index.d.ts) in the package. my class in typescript is : import 'fuse.js'; export class Myclass{ /**some code*/ public…
ilDug
  • 553
  • 1
  • 4
  • 11
4
votes
2 answers

React & Fuse js with TypeScript

I have this error message when using Typescript with Fuse.js TS2345: Argument of type '{ keys: string; }' is not assignable to parameter of type 'FuseOptions<{ 'ISBN': string; 'title': string; 'author': string; }>'.…
R.Dixon
  • 107
  • 2
  • 11
4
votes
2 answers

How do I use a js dependency after I do NPM install?

How do I use a dependency in my javascript after I install it using npm? I just used NPM to install Fuse.js. npm install fuse.js Then the website says to use the program I just have to add the following code and it will work: var books = [{ …
Whitecat
  • 3,882
  • 7
  • 48
  • 78
3
votes
1 answer

limit search results in fuse.js vue

I've implemented fuse.js with this guide : https://fusejs.io/ and the code : const Fuse = require("fuse.js"); var fuse = new Fuse(this.$store.state.vendorProducts, options); var result = fuse.search(this.itemTitle); the result variable…
mmarket
  • 61
  • 1
  • 3
3
votes
1 answer

How to weight items in a fuzzy search

Using Fuse.js, I need to weight individual item for a better ranking in search results. For instance, how do I make sure "Paris France" has the biggest score for a "Paris" query with the data below? places = [{ name: 'Paris, France' weigth:…
Félix Ménard
  • 453
  • 4
  • 10
3
votes
0 answers

Fuse.js with nested data returns wrong ID

Im using http://fusejs.io/ to search some json data. The data is big list of cabinets that each contain n number of items. Data example: {"cabinets":[ {"cabinet":"A4","items":[ {"title":"Toys","keywords":"leksaker, pingpong, kendama,…
David Lamm
  • 519
  • 1
  • 3
  • 12
3
votes
2 answers

Fuse.js: Fuzzy search in Array like object

I would like to perform a fuzzy search on an Object with a flat hierarchy. On the demo page of Fuse.js you have to specify a key / keys to look for in the Object. Unfortunately I do not have a specific identifier. Fuse.js Demo: var books = [{ …
marcobiedermann
  • 4,317
  • 3
  • 24
  • 37
3
votes
0 answers

Search object by key from json layer made by overpass api

Im building sport facilities map based on leaflet. Im using Overpass API to get object data and make one layergroup for one type sports facilites. var swimming = new L.LayerGroup(); var swimming_node = new L.layerJSON({ url:…
ems
  • 31
  • 2
2
votes
2 answers

How to implement fulltext search for offline website

I need a client-side fulltext search for big offline website. The site is opened by browser. I've made a research and found some solutions - fullproof, fuse.js, flexsearch.js, elasticlunr.js. I searched for js libs, because as i inderstand, it's the…
TreshUp
  • 76
  • 8
2
votes
0 answers

Fuse JS search results scoring doesn't make sense

I'm trying to use Fuse JS to do a fuzzy search on a list of strings but the results it's giving back don't make sense. I've set up a playcode here as an example. Here my list is [ "Yoga with Adriene - Revolution", "Brewdog beers", "NBA…
user2086359
  • 325
  • 3
  • 13
1
2 3 4