There is no config which you can change to adapt the logic. It's hardcoded.
Sitecore.Search.Crawlers.DatabaseCrawler
adds content to the _content
field.
In the AddAllFields
method there is:
item.Fields.ReadAll();
foreach (Sitecore.Data.Fields.Field field in item.Fields)
{
bool tokenize = this.IsTextField(field);
FieldCrawlerBase fieldCrawler = FieldCrawlerFactory.GetFieldCrawler(field);
if (this.IndexAllFields)
document.Add((IFieldable) this.CreateField(field.Key, fieldCrawler.GetValue(), tokenize, 1f));
if (tokenize)
document.Add((IFieldable) this.CreateField(BuiltinFields.Content, fieldCrawler.GetValue(), true, 1f));
}
So after it adds crawled value to the proper document field, it also adds value to the _content
(if IsTextField
returned true).
The logic is skipped if Exclude From Text Search - Turn on to ignore the contents of this field in the full text search index
box is checked on the field (copied from Chris Auer comment).
And here is the list of types of fields which are considered as TextFields
:
"Single-Line Text"
"Rich Text"
"Multi-Line Text"
"text"
"rich text"
"html"
"memo"
"Word Document"
Also copied from Artsem Prashkovich comment so it's visible:
In addition to the first defenition of the _content field is in the Sitecore.ContentSearch.AbstractDocumentBuilder<T>
class defined in the Sitecore.ContentSearch.dll
. There is the AddSpecialFields
method with the following code:
this.AddSpecialField("_content", (object) indexable3.Name, false);
this.AddSpecialField("_content", (object) indexable3.DisplayName, false);
It means the Name
and DisplayName
of item also in the _content
field.