3

I have indexed my content in the SOLR 8.8.2 and the tags available on those items are being pushed in the SOLR as below:

{
    "description_t_en":"Lorem Ipsum is simply dum",
    "_templatename":"Insights Detail Page",
    "_creator":"",
    "sxatags_sm":["Gaming","Managed Services"],
    "_language":"en",
    "authored_date_tdt":"2022-05-21T00:00:00Z",
    "_uniqueid":"sitecore://master/{c8921b82-10c5..."
}

Now, due to some custom requirements, I want to map the Solr field sxatags_sm into my model as below:

[IndexField("sxatags_sm")]
  [DataMember]
  [TypeConverter(typeof(IndexFieldEnumerableConverter))]
  public virtual IEnumerable<string> TaggedIndustryAndServices { get; set; }

But I am not getting these values in my model. Any idea why is this so?

3
  • Please try without postfix "_sm". For ex. IndexField("sxatags"). Commented May 27, 2022 at 12:51
  • No, it is still null. Commented May 27, 2022 at 13:12
  • I would also suggest removing the TypeConverter attribute as well as the _sm postfix. Commented May 28, 2022 at 0:34

1 Answer 1

0

Adding this in the custom Sitecore index config works for me!

<fieldNames hint="raw:AddFieldByFieldName">
    <field fieldName="sxatags" returnType="stringCollection"/> 
</fieldNames>
3
  • Is your index configured with <IndexAllFields>false</IndexAllFields>? Commented May 28, 2022 at 0:36
  • Yes, does this cause any issue? Commented May 28, 2022 at 14:25
  • No issue, but it explains why the field wasn’t added to the index by default. This was the root of your problem. Commented May 30, 2022 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.