Sam
Sam

Reputation: 111

SOLR - facets returned change when facet.limit is modified

This is for solr cloud.

When facet.limit is say 50, a set of facets are returned for a query sorted by default count.

Engineer (20)

Doctor (18)

Teacher (15)

When facet.limit is say 100, a different set of facets are returned for a query.

Lawyer (25)

Engineer (20)

Doctor (18)

Teacher (15)

The list doesn't change a lot, but a few missing facets are now returned when facet.limit is increased.

Why is the facet list inconsistent? Please advice.

Upvotes: 0

Views: 595

Answers (1)

Toke Eskildsen
Toke Eskildsen

Reputation: 729

In a distributed setting, ensuring exact facet results has a worst-case of having to request the full facet result (effectively facet.limit=-1) from all shards. For high cardinality fields this can be extremely heavy.

To avoid excessive hardware requirements, Solr uses over provisioning on the given facet.limit. So the result is "often" correct, but by the nature of heuristics, it sometimes fails. You can adjust the over provisioning parameter to raise the chance of getting correct results: https://cwiki.apache.org/confluence/display/solr/Faceting#Faceting-Over-RequestParameters

Upvotes: 2

Related Questions