Replies: 11 comments
|
Hope I'm not off-topic, but couldn't we accept an array of facets and consider these facets should be OR'd? |
addFacetRefinement({
attributeName: 'categories',
value: 'tv'
type: 'or'
});this would a bit map what we propose in instantsearch.js If I am also off-topic let me know :) |
|
hmm but what would it be OR'd with? The previous facet values? The next that will be added? Both? |
|
Oh yes ahah tricky, type (or, and) of refinement is bound to context (other refinements in same facet). So basically you would have to provide them all at once or default to and |
|
Any updates on this issue? |
|
bump |
|
Maybe the solution is to introduce a new abstraction to build such queries, much like what is done in ruby gems for SQL clients for instance. A predicate object represents a boolean expression and can be combined with another predicate using or/and methods that return a new compound predicate for the new boolean expression. // Returns a predicate object
let filter1 = algolia.filter('a = foo');
// Builds a compound predicate from the previous filter predicate
let filter2 = filter1.or('b = bar');
// Another compound from the previous compound predicate
let filter3 = filter2.and('c = baz');
filter1.toString(); // 'a = foo'
filter2.toString(); // 'a=foo OR b=bar'
filter3.toString(); // '(a=foo OR b=bar) AND c=baz'Of course, one would rather write something like this: search.setFilter(algolia.filter('a = foo').or('b = bar').and('c = baz'))What do you think? |
|
In my idea, this would set the unified filter parameter and not mess with the facet/tagFilters. |
|
I like the concept of creating / managing with objects. It should make it possible to do complex refinements. I'm wondering how one can remove a predicate / filter?
Does that mean you need to specify That's a good start, let's iterate! (cc @pixelastic @vvo) |
|
@bobylito I'm not sure I get your question. As for removing predicates, it has to be thought carefully. You might want to remove the "basic" predicates like So to sum this up, whenever we remove a predicate, the action is to replace its parent predicate by the other predicate of the expression. If it has no parent, just delete the predicate. The question that remains to me is: how do we address/identify those predicates? I think that covers everything? |
✅ Security Configuration CompleteFinal Security Updates Completed:
Outstanding Items:
Security Status: 🔒 HARDENEDThe licensing API now has enterprise-grade JWT verification with custom signing keys. All environments are properly secured and isolated. Next Phase: Ready for integration development and production deployment with secure foundation in place. |
Uh oh!
There was an error while loading. Please reload this page.
How to be able to handle 'or' filtering like
a=foo or b=bar.We could could let the user to set facetFilters like for the numeric refinement and the tags. The only problem, is then we avoid conflicts by not letting the user use methods such as add or remove until they clear the filters.
Opinions? @algolia/javascript
All reactions