Try our conversational search powered by Generative AI!

Facet in UnifiedSearch for MetaData

Vote:
 

I have addead metadata containing commaseparetad strings, I would like to facet on those in Find.

I have tried  

query = query.TermsFacetFor(x => x.SearchMetaData["Publishers"].StringValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries));

But it does only give me a facet with name SearchMetaData.Publishers.StringValue.Split and no terms. How do i get facets on other properties in UnifiedSearch?

#150506
Edited, Jun 21, 2016 11:57
Vote:
 

I would probably wrap that string splitting in a separate method on the object and then make a client convention to index that and then facet on it. 

Check out

http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/12/DotNET-Client-API/Customizing-serialization/Including-fields/

If you don't want to modify your nice object with a new method, you can always make an extension method for it on that object type to keep it nice and clean.

#150513
Jun 21, 2016 14:04
Vote:
 

I got it to work. Ended up doing an extension method as you sugested. Thanks

#150518
Jun 21, 2016 14:55
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.