1

We're on Sitecore 8.1 update 2 and I'm having issues with the content search API. Its my understanding the _content field in the index should contain an amalgamation of all the fields in the template. Looking at this SO question: What class indexes the _content index field, there is a list considered by Sitecore as text fields.

However, in my instance, this isn't happening. I have indexAllFields true in my config. Confused, I yielded and made my own basic _content crawler as a computed field based very loosely on https://kamsar.net/index.php/2014/05/indexing-subcontent/.

It didn't work. I debugged and the first field - it's type came through as "Rich NewText" - it didn't match the list in the linked SO answer, so it didn't get indexed in my computed field.

I've searched high and low (including core field definitions) for "Rich NewText" type .. it's clear to me this is the reason it isn't updating my _content field.

Also..

"Single-Line Text" is coming through as "Single-Line NewText"

"Multi-Line Text" is coming through as "Multi-Line NewText"

Using lucene and done loads of Sitecore search stuff before and never came across this before.

Can't post configs/code as they're in my air-gapped dev environment and can't just copy/paste out :-/

Any ideas? Smells like a bug in this version of Sitecore?

UPDATE: So, after a dig, the sitecore.config file has this:

<replacers>
    <replacer mode="off" id="publish" type="Sitecore.Text.Replacer, Sitecore.Kernel" singleInstance="true">
      <param desc="name">$(id)</param>
      <replacements hint="raw:AddReplacement">
        <regex find="Test[12]" replaceWith="Test" simpleTest="Test" ignoreCase="true" forPublish="true" />
        <simple find="Text" replaceWith="NewText" ignoreCase="false" forPublish="true" />
      </replacements>
    </replacer>
  </replacers>

.. this is an out the box value (also present in Vanilla Sitecore 8.2 rev. 180406). Wonder why SC does this and why it affects the field type? Anyone know if I can just remove this from the config?

2
  • The mode of the replacer is set to "off". It should not be used. Maybe someone enabled it for a moment and saved a field /sitecore/system/Field types/Simple Types/Rich Text item in core database?
    – Marek Musielak
    Jan 30, 2019 at 7:34
  • @Marek - good spot. This is from the default, vanilla Sitecore config. In my project it's on. Unfortunately, source history has turned up no reason to switch it on or even when it was switched on, nor are any of the original devs still around. I can't imagine for one minute why this would be turned on.. I've never hit this issue in other projects (so assume it's always been off in every other project) .... sooooooo... off it goes! Thanks for the eagle eyes
    – stuartw87
    Jan 30, 2019 at 8:17

1 Answer 1

1

Sitecore replacers are used when publishing content. You can read more about them in the article:

https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/replacing-data-during-publication-with-the-sitecore-asp-net-cms

The configuration you pasted from the vanilla Sitecore config contains only 1 replacer and it's disabled (mode="off").

Someone must have enabled it at some point and publish your fields definition. That's why all your "Text" values were replaced with "NewText".

Disable the replacer and republish your site with republish option selected to make sure all your items in web database are processed.

1
  • Thanks for your help Marek. I have disabled that replacer and republished and it all works as expected now. Interesting (but I understand why it would be) that Sitecore also replaces it's own field types values too :-/
    – stuartw87
    Jan 30, 2019 at 12:26

Your Answer

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

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