Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/425.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在对象数组中搜索的结果_Javascript_Fuse.js - Fatal编程技术网

Javascript 在对象数组中搜索的结果

Javascript 在对象数组中搜索的结果,javascript,fuse.js,Javascript,Fuse.js,我使用fuse.js在对象数组中搜索,比如 它返回标记匹配的整个项目。 如何知道哪些标记匹配?设置选项时,请将详细设置为真实。这将使用匹配的键将匹配的分数记录到控制台 const options = { verbose: true, shouldSort: true, threshold: 0.6, location: 0, distance: 100, maxPatternLength: 32, minMatchCharLength: 1, keys: [

我使用fuse.js在对象数组中搜索,比如

它返回标记匹配的整个项目。
如何知道哪些标记匹配?

设置选项时,请将详细设置为真实。这将使用匹配的键将匹配的分数记录到控制台

const options = {
  verbose: true,
  shouldSort: true,
  threshold: 0.6,
  location: 0,
  distance: 100,
  maxPatternLength: 32,
  minMatchCharLength: 1,
  keys: [
    "title",
    "author.firstName"
  ]
};
const fuse = new Fuse(list, options);