Building Term Facet For JSON object


Hi All ,

Hope you are all doing well . 

I have been facing an issue to build a Term facet . 

My JSON object in FIND index will be like below

 "FilterAttributes": {
        "thredcount": "100",
        "colour": "blue",
        "Size": "small"

I am using the below code to build the Term Facet


unfortunately its not working as I expected .  Term Facet count always zero.

Expected result : 

blue (1)

Request you all to let m eknow what worng woth my code.

CMS Version 11

Commerce Version 11

Find version 13


Venkata Phani kumar R

Apr 24, 2018 3:18

Looks like FilterAttribues is a property of some type in Newtonsoft.Json?

I would either convert FilterAttributes to a real C# property based on a custom class or something like a Dictionary<string, string>().

Apr 24, 2018 22:19

Hi John,

Thanks for your reply .

As you mentioned I have converted the Property into Dictonary Property .

 "FilterFacetValues": {
        "Values": [
        "colour$$string": "red",
        "thredcount$$string": "100",
        "$type": "System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089]]",
        "Size$$string": "small",
        "Keys": [

buliding termfacet like this  .TermsFacetFor(x=>x.FilterFacetValues["colour"]).

Its working .

Thanks for your help and advice.

Venkata Phani kumar R
Apr 25, 2018 1:45
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.