Adding Computed Field in Sitecore 9

Posted by

I would like to share an instance in Sitecore 9 when I was trying to add a computed field in SOLR .

For which I added the following configuration

Below is the configuration from Sitecore version before 9 :

computed field 8

Post that I rebuild the indexes to create the field.
But here is the situation that it didn’t get added into the Indexes of SOLR.

Here is the fix for this issue, hopefully it saves your time and you can jump to the development rather then getting stuck in configuration.

In sitecore 9, there is a term called as “<documentOptions>” which comes into the picture.

When we open the search index config, we can see the sections where we define included and excluded templates, fields etc. are now wrapped with documentOptions tag.

Below is the configuration from Sitecore 9

computed field 9

So here we can see that once we wrap our custom field into documentOptions and rebuild our indexes, field will be added into SOLR.

If it was helpful to all you Sitecore aspirants and saved your time you can thank me by buying me a beer 🙂

Leave a Reply