Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Can't find TermsFacetFor overload with Size param


I'm seeing in the docs for Find that TermsFacetFor has "... an overload that allows to specify the number of terms to return. If no size is specified the service defaults to ten."

I can't seem to find this overload and always get 10 terms back. What am I missing? Using EPi7 and the latest versions from NuGet.

Jan 23, 2013 11:28


The overload doesn't explicitly take a size param but rather a delegate with which you can modify the "facet request". So, something like .TermsFacetFor(x => x.SomeProp, r => r.Size = 50) should work.

Jan 23, 2013 12:03

Not working straight off. Tried some different syntax takes but can't manage to have r into a TermsFacetRequest and set the Size prop. Would be great if I could get some code from a wet run. Thanks!

Jan 24, 2013 12:00
.TermsFacetFor(x => x.SearchSection, r => r.Size = 50)

Works (cut-n-pasted from a project). Note that this is the TermsFacetFor call you do on the search/query. When you extract the facet, also using a method named TermsFacetFor, you don't need to, and can't specify size.

If you can't get it to work, could you paste the (compilation) error?



Jan 24, 2013 12:14

Doh, of course it needs to be set before calling Find! I was on the TermsFacetFor() of the UnifiedSearchResult... Thanks!

Jan 24, 2013 12:21
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.