dart_algolia
dart_algolia copied to clipboard
Fix tagFilters implementation, adding tagFilters with OR relations
The current tagFilters implementation does not support OR relations, and it has implementation errors which should throw errors, but luckily dart/flutter does not throw (yet). This PR fixes both.
The bug fixed: _paramters['tagFilters'] is created as a List<List<String>> and is cast to a List<String>. Interestingly, this does not throw currently, but I guess there is no guarantee it will not throw one day.
The Feature added: Allow for a combination of AND and OR Tag filters such as:
tag1 AND (tag2 OR tag3) AND (tag4 OR tag5) AND tag6
this is created by defining tagFilters like this:
{
"tag1",
[ "tag2", "tag3" ],
[ "tag4", "tag5" ],
"tag6"
}
would love to see this merged, thanks :)
happy if somebody wants to add some docs above but didn't take the time as most other functions do not have serious docs anyway
@nhathiwala would really like to see this merged :)