Web / Apache Solr Interview questions
How do you apply faceting in a Solr query?
Faceting returns counts of documents grouped by field values alongside the normal search results, powering filters like "Brand (Nike: 42, Adidas: 31)" on an e-commerce page.
/select?q=laptop &facet=true &facet.field=brand &facet.range=price &facet.range.start=0 &facet.range.end=2000 &facet.range.gap=500
facet.field buckets by exact field values, while facet.range buckets numeric or date fields into ranges. Solr also offers facet.pivot for nested, multi-level facets and the newer JSON Facet API for more complex aggregations in a single request.
More Related questions...