How do I set the field names inserted into the index to something different than my property names?

Vote:
 

How do tell the EpFind.Api to set the field names for certain properties to have the $$Type on them with an ATTRIBUTE?

I had to turn off this feature for most of my objects properties, but I need the fields below to APPEAR like this and currently they are now missing the $$string.

What is the attribute that will let me SET JUST these properties to have these names?

#276968
Mar 22, 2022 23:32
Vote:
 

Have a look at the bottom code sample in this excellent blog post:
https://world.optimizely.com/blogs/Per-Magne-Skuseth/Dates/2016/1/episerver-find-index-blocks-in-xhtmlstring/

Something like this...??

SearchClient.Instance.Conventions.ForType<XhtmlString>().Field(x => x.SearchSection).Modify(x => x.PropertyName = "SearchSection" + TypeSuffix.String);
#276982
Mar 23, 2022 11:26
Vote:
 

Yeah that does it! I tried that and it works!

Also I tried [JsonProperty(name$$string)] and it respects that as well.

So I am set!

#276984
Mar 23, 2022 12:11
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.