{"action":"closed","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-helper-js/issues/98","labels_url":"https://api.github.com/repos/algolia/algoliasearch-helper-js/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-helper-js/issues/98/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-helper-js/issues/98/events","html_url":"https://github.com/algolia/algoliasearch-helper-js/issues/98","id":85789737,"number":98,"title":"Advanced tags filtering","user":{"login":"bobylito","id":393765,"avatar_url":"https://avatars.githubusercontent.com/u/393765?v=3","gravatar_id":"","url":"https://api.github.com/users/bobylito","html_url":"https://github.com/bobylito","followers_url":"https://api.github.com/users/bobylito/followers","following_url":"https://api.github.com/users/bobylito/following{/other_user}","gists_url":"https://api.github.com/users/bobylito/gists{/gist_id}","starred_url":"https://api.github.com/users/bobylito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobylito/subscriptions","organizations_url":"https://api.github.com/users/bobylito/orgs","repos_url":"https://api.github.com/users/bobylito/repos","events_url":"https://api.github.com/users/bobylito/events{/privacy}","received_events_url":"https://api.github.com/users/bobylito/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"bobylito","id":393765,"avatar_url":"https://avatars.githubusercontent.com/u/393765?v=3","gravatar_id":"","url":"https://api.github.com/users/bobylito","html_url":"https://github.com/bobylito","followers_url":"https://api.github.com/users/bobylito/followers","following_url":"https://api.github.com/users/bobylito/following{/other_user}","gists_url":"https://api.github.com/users/bobylito/gists{/gist_id}","starred_url":"https://api.github.com/users/bobylito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobylito/subscriptions","organizations_url":"https://api.github.com/users/bobylito/orgs","repos_url":"https://api.github.com/users/bobylito/repos","events_url":"https://api.github.com/users/bobylito/events{/privacy}","received_events_url":"https://api.github.com/users/bobylito/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/algolia/algoliasearch-helper-js/milestones/2","html_url":"https://github.com/algolia/algoliasearch-helper-js/milestones/2.1.0","labels_url":"https://api.github.com/repos/algolia/algoliasearch-helper-js/milestones/2/labels","id":1046779,"number":2,"title":"2.1.0","description":"This version will aim to provide new features beyond the refactoring of v2. It will also be the occasion to consolidate the current base of tests and documentation.","creator":{"login":"bobylito","id":393765,"avatar_url":"https://avatars.githubusercontent.com/u/393765?v=3","gravatar_id":"","url":"https://api.github.com/users/bobylito","html_url":"https://github.com/bobylito","followers_url":"https://api.github.com/users/bobylito/followers","following_url":"https://api.github.com/users/bobylito/following{/other_user}","gists_url":"https://api.github.com/users/bobylito/gists{/gist_id}","starred_url":"https://api.github.com/users/bobylito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobylito/subscriptions","organizations_url":"https://api.github.com/users/bobylito/orgs","repos_url":"https://api.github.com/users/bobylito/repos","events_url":"https://api.github.com/users/bobylito/events{/privacy}","received_events_url":"https://api.github.com/users/bobylito/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":8,"state":"open","created_at":"2015-03-31T12:16:55Z","updated_at":"2015-06-08T14:38:55Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-06-06T18:12:09Z","updated_at":"2015-06-08T14:38:54Z","closed_at":"2015-06-08T14:38:54Z","body":"Algolia API supports AND, OR and NOT filtering. How to provide a good API that easy to read, combine and manipulate?\r\n\r\nIn 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.\r\n\r\nMaybe 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 :\r\n\r\n```javascript\r\nvar tagList = new TagList( \"romantic\", not( \"horror\" ) );\r\nvar orGroup = new OrGroup( \"dinner\", \"musical\" );\r\ntagList.add( orGroup );\r\nhelper.setTagList( tagList );\r\n//later...\r\nvar l = helper.getTagList();\r\nvar excludeTags = l.getExcludedTags();\r\nexcludeTags.remove( \"horror\" );\r\nvar orGroups = l.getOrGroups();\r\norGroups.first().remove( \"musical\" );\r\nhelper.setTagList( tagList );\r\n```\r\n\r\nThis API wouldn't be enough or satisfying but that's some food for thinking...\r\n\r\nThis problem is definitely related to #35 with similar issues and API constraints."}}