mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Facet documentation tweaks
This commit is contained in:
parent
af0e91e776
commit
fadeafd781
1 changed files with 9 additions and 9 deletions
|
|
@ -12,9 +12,9 @@ Facets can be specified in two ways: using queryset parameters, or in ``metadata
|
||||||
Facets in querystrings
|
Facets in querystrings
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
To turn on faceting for specific columns on a Datasette table view, add one or more ``_facet=COLUMN`` parameters to the URL. For example, if you want to turn on facets for the ``city`` and ``state`` columns, construct a URL that looks like this::
|
To turn on faceting for specific columns on a Datasette table view, add one or more ``_facet=COLUMN`` parameters to the URL. For example, if you want to turn on facets for the ``city_id`` and ``state`` columns, construct a URL that looks like this::
|
||||||
|
|
||||||
/dbname/tablename?_facet=state&_facet=city
|
/dbname/tablename?_facet=state&_facet=city_id
|
||||||
|
|
||||||
This works for both the HTML interface and the ``.json`` view. When enabled, facets will cause a ``facet_results`` block to be added to the JSON output, looking something like this::
|
This works for both the HTML interface and the ``.json`` view. When enabled, facets will cause a ``facet_results`` block to be added to the JSON output, looking something like this::
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue