1

I have a single line field in Sitecore, (I see same issue for other field types too). I am trying to do a SOLR search on this field. I created a search result class

public class SearchResult : SearchResultItem
{
    [IndexField("page_heading")]
    public string PageName { get; set; }
}

In the index, I see the field as expected page_heading_t with corresponding values on it.

enter image description here

But when I do a search on this field, using the above property, I dont see results, and in the search log, I see:

enter image description here

When I run this same query in solr, after appending the _t suffix to the fields, I see results as expected:

enter image description here

However, the suffix is not getting appended as expected on the query generated by the code. Any ideas?

I have verified that this field exists only on 1 template on the instance (which is used as the base template on multiple templates)

5
  • What does your configuration setting look like for the new field? Perhaps the returnType needs to be set. May 12 '20 at 16:16
  • Is this an upgrade or a custom SOLR index? Your configs seem to be off since the your fields are not being transformed into the right field names.
    – Chris Auer
    May 12 '20 at 16:24
  • Its a single line text - built in field - does that answer the question? I am using a custom index - but it uses the default solr configuration.
    – Durga Bose
    May 12 '20 at 16:25
  • It is not an upgrade, and I am on Sitecore 9.2
    – Durga Bose
    May 12 '20 at 16:27
  • @DurgaBose, are you adding the field in the index by specifying it in the section <include hint="list:AddIncludedField"> or is the <indexAllFields> set to true?
    – adarsh
    May 25 '20 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.