#community-help

Understanding Faceting in Search Parameters

TLDR Vera asked for clarity on faceting, and Jason provided an explanation, using a specific example to illustrate its function.

Powered by Struct AI

1

1

Nov 02, 2021 (27 months ago)
Vera
Photo of md5-9705f56a1717a43e33fa1a08fce4c4ba
Vera
09:53 PM
where can i find some information on what exactly faceting does? somewhat confused
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:55 PM
When you include a field in the facet_by search parameter, it essentially returns a count of the number of records that have that value
09:55
Jason
09:55 PM
So for eg: on this page: https://songs-search.typesense.org/?songs_1630520530850%5Bquery%5D=Annie%27s%20song%20Denver

release_date is set as a facet_by field, and that's what returns the counts next to each release year

1

Vera
Photo of md5-9705f56a1717a43e33fa1a08fce4c4ba
Vera
09:58 PM
that makes sense thank you for clarifying

1

Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
09:59 PM
Was just typing out a reply to your email as well when you sent this Slack message 🙂