Search code examples
limitravendbfacet

Retrieve all facets for RavenDB query when facets for a given key are over 1024


When I apply the 'ToFacets("facets/CameraFacets")' extension on the 'IQueryable' that comes from my query, I find the count on one of the 'IEnumerable' collections against a facet in the dictionary is 1024. I know for sure there are more, but how do I retrieve them? Will increasing the safe limit automatically give me all values, also is there another way of doing this without having to increase that limit?


Solution

  • Yes if you change the safe limit it will pull in more facets, take a look at the HandleTermsFacet(..) in the code.

    However, I wouldn't recommend it. It's a perf issue because 1024 facets means you are doing 1024 seperate queries.

    If you need to deal with this many facets, you are better off using a Map/Reduce index, also see this blog post