0
votes

I have documents with multiple facets. I have different views on the website I'm creating to view the facet stats.

As well as showing the facet stats, I would like to show example documents from each facet - specifically, the first and last documents ordered by another field.

For example, properties for sale, I want to see the first and last (based on price) for each facet (the facet can be street, area, city, post code etc).

I can solve this by calling SOLR multiple times for each facet, but it seems like something that should be built in and if so, it would reduce roundtrips a LOT. (it would mean probably 2 SOLR calls per page instead of 30 or possibly more)

1

1 Answers

1
votes

Instead of faceting, you can look into

https://wiki.apache.org/solr/FieldCollapsing

Then you need to do only two queries with group.sort ASC or DESC on the field by which you want to sort.