Can't find TermsFacetFor overload with Size param

Vote:
 

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.

#65216
Jan 23, 2013 11:28
Vote:
 

Hi,

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.

#65218
Jan 23, 2013 12:03
Vote:
 

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!

#65264
Jan 24, 2013 12:00
Vote:
 
.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?

 

 

#65265
Jan 24, 2013 12:14
Vote:
 

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

#65266
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.