?_nosuggest=1 parameter for table views, closes #1557

This commit is contained in:
Simon Willison 2021-12-16 11:24:54 -08:00
commit 992496f261
3 changed files with 20 additions and 0 deletions

View file

@ -388,6 +388,7 @@ class TableView(RowTableShared):
nocount = request.args.get("_nocount")
nofacet = request.args.get("_nofacet")
nosuggest = request.args.get("_nosuggest")
if request.args.get("_shape") in ("array", "object"):
nocount = True
@ -846,6 +847,7 @@ class TableView(RowTableShared):
and self.ds.setting("allow_facet")
and not _next
and not nofacet
and not nosuggest
):
for facet in facet_instances:
suggested_facets.extend(await facet.suggest())