Mauravan
Mauravan

Reputation: 39

useExtendedSearch with AND produces unexpected result in demo

Using the demo with these Settings:

const Fuse = require('fuse.js');

const fuseOptions = {
    // isCaseSensitive: false,
    // includeScore: false,
    // shouldSort: true,
    // includeMatches: false,
    // findAllMatches: false,
    // minMatchCharLength: 1,
    // location: 0,
    threshold: 0,
    // distance: 100,
    useExtendedSearch: true,
    // ignoreLocation: false,
    // ignoreFieldNorm: false,
    // fieldNormWeight: 1,
    keys: [
        "title",
        "author.firstName"
    ]
};

const fuse = new Fuse(list, fuseOptions);

// Change the pattern
const searchPattern = "Dan Code"

return fuse.search(searchPattern)

I would expect the search to return

  {
    "title": "The DaVinci Code",
    "author": {
      "firstName": "Dan",
      "lastName": "Brown"
    }
  },

Because it should be interpreted as: Fuzzy(Code) AND Fuzzy(Dan). Searching both values individually will give the desired output.

Am i interpreting this wrong?

Upvotes: 0

Views: 9

Answers (0)

Related Questions