Skip to content

Commit

Permalink
Test and docs for ?_facet_size=max, refs #1337
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed May 27, 2021
1 parent 7e983fe commit 4545120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/json_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ Special table arguments
Facet by column. Can be applied multiple times, see :ref:`facets`. Only works on the default JSON output, not on any of the custom shapes.

``?_facet_size=100``
Increase the number of facet results returned for each facet.
Increase the number of facet results returned for each facet. Use ``?_facet_size=max`` for the maximum available size, determined by :ref:`setting_max_returned_rows`.

``?_trace=1``
Turns on tracing for this page: SQL queries executed during the request will
Expand Down
6 changes: 6 additions & 0 deletions tests/test_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,9 @@ async def test_facet_size():
)
data4 = response4.json()
assert len(data4["facet_results"]["city"]["results"]) == 20
# Test _facet_size=max
response5 = await ds.client.get(
"/test_facet_size/neighbourhoods.json?_facet_size=max&_facet=city"
)
data5 = response5.json()
assert len(data5["facet_results"]["city"]["results"]) == 20

0 comments on commit 4545120

Please # to comment.