Hi, is there an ETA on "negative faceting" e.g. "-...
# community-help
s
Hi, is there an ETA on "negative faceting" e.g. "-Apples"? That is kind of the last roadblock for me to get rid of my crazy algolia bill
k
👋 I can assess the changes needed and give you an update later. In the mean time, the issues you identified with highlighting and typo correction should be fixed in
0.20.0.rc49
docker image. It will be great if you can give it a spin and let me know if it works!
s
Awesome thank you! And I just upgraded and it seems to be fixed! Thank you Only minor thing: I assume typesense doesn't ignore dashes?
k
A word like
catch-up
will be indexed as
catchup
.
If you want it to be indexed as a two separate words, you have to split it up before indexing.
s
okay that is doable
@Kishore Nallan you got a chance to estimate the workload for negative filtering?
k
End of the week, if I don't run into any blockers during implementation.
👍 1
s
Awesome thank you
k
@Stefan Hesse Just to be clear: when you say negative faceting, you mean negative
filtering
right? So, something like 
color:- blue
 would match records which are not blue.
s
Yes exactly
k
Cool. I've started working on it.
🎉 1
s
Awesome! Happy to alpha test at anytime!
k
@Stefan Hesse I've got an early build for you to test:
typesense/typesense:0.21.0.rc2
Currently supporting the exclusion operator (
-
) on only string facets. Usage:
filter_by=author:- JK Rowling
(excludes a single value)
filter_by=author:- [JK Rowling, Enid Blyton]
(excludes both authors) If you want to include some and exclude others you can have two filter_by clauses separated by
&&
e.g.
filter_by=author:- [JK Rowling, Enid Blyton] && author: [JRR Tolkien, John Grisham, George Martin]
Though the last example doesn't make any sense for the same field. But just to give a gist.
Please use
typesense/typesense:0.21.0.rc4
-- this also has a fix for the other bug you identified @Stefan Hesse -- the issue of escaping commas in filter value list during filtering. You can now wrap strings in backtick (`) to achieve that. E.g.
Copy code
place: [`London, UK`, `Paris, France`]
s
Awesome, thank you! Already playing with it 🙂
it seems to be working pretty flawless so far. I already took a stab at adding it to the instantsearch adapter @Jason Bosco do you have something planned there as well?
j
@Stefan Hesse I haven’t added it to the adapter yet. If you’ve already done it, a PR would be awesome!
s
I started working on it, works, but is a bit buggy. I will create a draft PR so we can discuss what would be the best approach.
👍 1
j
s
sure will do! Probably won't get it to it today, but tomorrow for sure
k
One current limitation is that it only works for string facets. Just something to be aware of during implementation, and we will eventually add support for other types.