{"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/427#issuecomment-481940539", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/427", "id": 481940539, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4MTk0MDUzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-11T02:26:43Z", "updated_at": "2019-04-11T02:26:43Z", "author_association": "OWNER", "body": "I quite like the Solr idea. It could look like this for Datasette:\r\n\r\n`?_facet=name` - default behaviour, same as today. But that's actually an alias for `?_facet.name=name` - which defines a name for the facet.\r\n\r\n`?_facet.tags.array=tags` - would define a facet called `tags` that uses an array facet against the `tags` column.\r\n\r\nI don't like the need to say `tags` twice in that though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 431800286, "label": "New design for facet abstraction, including querystring and metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/427#issuecomment-481957014", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/427", "id": 481957014, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4MTk1NzAxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-11T04:05:07Z", "updated_at": "2019-04-11T04:05:07Z", "author_association": "OWNER", "body": "OK, I have a plan:\r\n\r\n`?_facet=foo`\r\n`?_facet_facettype=options`\r\n\r\nOptions here can be one of the following:\r\n\r\n- A single value which is the name of a table\r\n- A comma separated list of options\r\n- A JSON object starting with `{` or `[`\r\n\r\nIf the table name itself contains a `,`, `{` or `]` then you have to escape it by putting it in a JSON object, `?_facet_percentile={\"column\":\"{this_is,a_weird[column_name\"}` for example.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 431800286, "label": "New design for facet abstraction, including querystring and metadata.json"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/427#issuecomment-481957313", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/427", "id": 481957313, "node_id": "MDEyOklzc3VlQ29tbWVudDQ4MTk1NzMxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-04-11T04:07:00Z", "updated_at": "2019-04-11T04:07:40Z", "author_association": "OWNER", "body": "This means the `metadata.json` format can look like this:\r\n```\r\n{\r\n \"databases\": {\r\n \"sf-trees\": {\r\n \"tables\": {\r\n \"Street_Tree_List\": {\r\n \"facets\": [\"qLegalStatus\", {\"array\": \"tags\"}, {\"percentile\": {\"blah\": \"options\"}}]\r\n }\r\n }\r\n }\r\n }\r\n}\r\n```\r\n\r\nSo any advanced facets are represented here as a dictionary with a single key - the type - that maps to the options.\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 431800286, "label": "New design for facet abstraction, including querystring and metadata.json"}, "performed_via_github_app": null}