krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.89k stars 759 forks source link

Extended search with include-match always return matches with score: 1 ? #485

Closed ajboni closed 3 years ago

ajboni commented 3 years ago

If I do an include-match extended search like 'deploy all results have score 1 and ignores any field weight as well.

Is this expected behaviour?

  /* Setup Fuse */
  const fuseOptions = {
    includeScore: true,
    includeMatches: true,
    findAllMatches: false,
    ignoreLocation: true,
    threshold: 0.3,

    useExtendedSearch: true,
    // ignoreFieldNorm: true,
    keys: [
      { name: "plainTextContent", weight: 1 },
      { name: "title", weight: 2 },
      { name: "url", weight: 0.5 },
    ],
  };
  const fuseIndex = Fuse.parseIndex(searchIndex);
  fuse = new Fuse(searchDatabase, fuseOptions, fuseIndex);
  const results = fuse.search(`'${str}`);

}

image

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days