itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing example in readme.md

cristianvasquez opened this issue · comments

Hi,

I'm testing the library using the example of README.md,

but it fails:

At:   node_modules/fastbitset/FastBitSet.js:488

const count = Math.max(this.words.length, otherbitmap.words.length);
TypeError: Cannot read properties of undefined (reading 'words')

Hey @cristianvasquez, thanks for info. It's fixed now

@cigolpl, Do you know what was wrong here? We are getting the same error so maybe there is something wrong with our data but I can't figure out what went wrong.

@carolineboeykens, in that case:

const movies = itemsjs.search({
  per_page: 1,
  sort: 'name_asc',
  // full text search
  // query: 'forrest gump',
  filters: {
    tags: ['1980s']
  }
})

the tag: "1980s" was not present in a JSON.

Itemsjs should handle it and i.e. throw Error with "The filter value does not exist" so it would be clear