{"html_url": "https://github.com/simonw/datasette/issues/359#issuecomment-489076725", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/359", "id": 489076725, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4OTA3NjcyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-03T12:20:38Z", "updated_at": "2019-05-03T12:20:38Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures/facetable?_facet_array=tags#facet-tags", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 349827640, "label": "Faceted browse against a JSON list of tags"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/359#issuecomment-481939013", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/359", "id": 481939013, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4MTkzOTAxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-11T02:17:55Z", "updated_at": "2019-04-11T02:17:55Z", "author_association": "OWNER", "body": "Challenge: facets can also be defined in `metadata.json` like this:\r\n\r\n```\r\n{\r\n \"databases\": {\r\n \"sf-trees\": {\r\n \"tables\": {\r\n \"Street_Tree_List\": {\r\n \"facets\": [\"qLegalStatus\"]\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nBut... `?_facet_array=definitions` doesn't fit in that data structure. Need to have an alternative mechanism for defining this kind of facet.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 349827640, "label": "Faceted browse against a JSON list of tags"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/359#issuecomment-481724452", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/359", "id": 481724452, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4MTcyNDQ1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-10T14:52:59Z", "updated_at": "2019-04-10T14:52:59Z", "author_association": "OWNER", "body": "I'm going to go with `?_facet_array=definitions` as the querystring argument for this.\r\n\r\nAnd `?definitions_arraycontains=foo` as the filter argument.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 349827640, "label": "Faceted browse against a JSON list of tags"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/359#issuecomment-412357691", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/359", "id": 412357691, "node_id": "MDEyOklzc3VlQ29tbWVudDQxMjM1NzY5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-08-12T17:17:29Z", "updated_at": "2018-08-12T17:17:29Z", "author_association": "OWNER", "body": "Note that there doesn't seem to be a way to use indexes (even [indexes on expressions](https://www.sqlite.org/expridx.html)) to speed these up, so this will only ever be effective on smaller data sets, probably in the 10,000-100,000 range. Datasette is often used with smaller data sets so this is still worth pursuing.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 349827640, "label": "Faceted browse against a JSON list of tags"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/359#issuecomment-412356746", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/359", "id": 412356746, "node_id": "MDEyOklzc3VlQ29tbWVudDQxMjM1Njc0Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-08-12T17:05:00Z", "updated_at": "2018-08-12T17:05:00Z", "author_association": "OWNER", "body": "And here's the query for pulling back every record tagged with a specific tag:\r\n\r\nhttps://latest-code.datasette.io/code-a26fa3c?sql=select+*+from+definitions+where+rowid+in+%28%0D%0A++select+definitions.rowid%0D%0A++from+definitions+join+json_each%28params%29+j%0D%0A++where+j.value+%3D+%3Atag%0D%0A%29&tag=filename\r\n\r\n```\r\nselect * from definitions where rowid in (\r\n select definitions.rowid\r\n from definitions join json_each(params) j\r\n where j.value = :tag\r\n)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 349827640, "label": "Faceted browse against a JSON list of tags"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/359#issuecomment-412356537", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/359", "id": 412356537, "node_id": "MDEyOklzc3VlQ29tbWVudDQxMjM1NjUzNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-08-12T17:01:21Z", "updated_at": "2018-08-12T17:01:39Z", "author_association": "OWNER", "body": "Example table: https://latest-code.datasette.io/code/definitions\r\n\r\nHere's a query that does facet counting against that column:\r\n\r\nhttps://latest-code.datasette.io/code-a26fa3c?sql=select+count%28*%29+as+n%2C+j.value+from+definitions+join+json_each%28params%29+j+group+by+j.value+order+by+n+desc%3B\r\n\r\n```\r\nselect count(*) as n, j.value\r\nfrom definitions join json_each(params) j\r\ngroup by j.value order by n desc;\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 349827640, "label": "Faceted browse against a JSON list of tags"}, "performed_via_github_app": null}