Hi, I have documents with a "city" facet field. I ...
# community-help
g
Hi, I have documents with a "city" facet field. I would like to display paginated list of cities. How could I browse all cities ? (page 1: 20 groups, page 2: 20 groups, etc) Also I don't want hits for each groups. I also tried with
facet_by
but it doesn't seem to be the proper way of doing it.
k
Looks like you want to show unique list of cities across all documents?
g
yes
k
Have you tried to do group_by of cities?
g
Yes I'm trying with group_by but: • I wonder if I'm browsing groups or documents using per_page/page • Also I cannot remove hits from results. I tried with limit_hits:0 (Also with "group_limit":1)
k
The actual group results won't matter for you: need to just look at the group keys.
You can set
group_limit: 1
to limit to just a single doc per group.
g
Thanks, it seems so far I can browse properly
Copy code
{
			"collection": "warehouses",
			"query_by": "name",
			"per_page": 20,
			"page":"1",
			"group_by": "city",
			"q":"",
			"sort_by":"city:asc",
            "group_limit": 1,
		}
k
😎