itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use
Apache License 2.0
346 stars 41 forks source link

How to filter down with "exact" match? #36

Closed regisphilibert closed 5 years ago

regisphilibert commented 5 years ago

I went through the readme extensively but could not find what I am looking for.

it seems that by default if I do

itemsJS.search({
  filters: [
     brands: ['toshi']
  ]
});

Every entries with brands

will be returned as results.

Is there a way to only return entries which have the brand toshi?

cigolpl commented 5 years ago

Hey @regisphilibert, as far as I remember when I designed ItemsJS the filters should work in the "exact" mode. This behaviour sounds like a bug. I'll check it out in about 7 days

cigolpl commented 5 years ago

Hey @regisphilibert, I've told to you I'll check it out in 7 days. Sorry I didn't have time. It's on my todo list though

regisphilibert commented 5 years ago

Don't worry about it, we put a workaround in place and it works great for now, so no rush on our part. Thanks for keeping me in the loop though!

Letrab commented 5 years ago

What was the workaround @regisphilibert ? By coincidence I experienced the "bug" as well, just now.

Will issue a PR to fix it. it only happens when your data, brands in this case, is just a string (so no collection).