-
Notifications
You must be signed in to change notification settings - Fork 46
Advanced tags filtering #98
Comments
There is an open feature request in the API backend to support the parsing of boolean expressions -> I would stuck to that and wouldn't implement anything in the API clients. We would do something like: |
The input is the least problematic part here. How do you edit the current tag filters? How do you query those tags? One thing that could help is a UI or any kind of software sample that uses the advanced combination of and or and negative tag capabilities. The way the user edit this kind of filter might give us an hint about how to do it properly. |
OK so let's make it simple :
One or the other API should have precedence, and I would say that once on the advanced you should not go back. Therefore I would make the advanced mode have the higher priority. |
//simple mode
helper.setTagMode = "or"; // and by default
helper.addTag( "romantic" )
helper.addTag( "beach" );
// advanced mode
helper.setRawTagFilter( "romantic, ( sea, city ), -mountain" ); |
I think that those advanced conditions are only applied programmatically, I would not go for anything else than your "advanced" API which is actually similar than Moreover, the facet & numeric filters also support those boolean expressions. |
OK agreed! |
We need to validate/verify that at the API level, otherwise it will be very difficult to maintain. Yeah, ideally we would be able to "merge" the filters :/ |
Hummm I'm interested in a strategy to merge the filters (tbh I have no idea which rules would make sense) |
* FIX : #29 Avoid callback for outdated queries * FIX : #64 Sum up the processing time of all queries * FIX : #92 Parameters that can be set in the dashboard shouldn't have defaults * FIX : #62 Make sure disctinct is set to false when it's not possible to use distinct in Algolia * FEATURE : #91 Support for tags (with support for the raw format #98) * FEATURE : #70 Ability to get all refined values : helper.getRefinements( facetname ) * FEATURE : #51 multiple filters for a single conjunctive facet (tests) * FEATURE : Ability to modify any parameter of the state easily (#76 #84 #12) * FEATURE : #69 Ability to know if a facet is refined, whatever the value * FEATURE : #86 Expose SearchParameters, AlgoliaSearchHelper, SearchResults to users directly in the builds * FEATURE : #25 let the user do a clearRefinement with a function as a filter * REFACTORING : SearchParameters is immutable (#14) * REFACTORING : Ensure SearchParameters is totally frozen (#14) * LIB : Update lodash version to 3.9.x
…mat of the tag API
Algolia API supports AND, OR and NOT filtering. How to provide a good API that easy to read, combine and manipulate?
In Flickr search, the provide a mode that let one query either in AND or OR mode. This does not provide any NOT feature. It is easy though and answer well the easiest cases for which you want to do either or and and filtering.
Maybe having a separate object for handling tag filters could be a solution, even though we ought to provide an object for or groups too... Just throwing some code here :
This API wouldn't be enough or satisfying but that's some food for thinking...
This problem is definitely related to #35 with similar issues and API constraints.
The text was updated successfully, but these errors were encountered: