1
votes

I have an index in Sitecore. One of the fields of the template being indexed is a treelist field called "tags". When I inspect the index using Luke, I see the field and it had values.

1.) The values in the tags index is the ID of the selected treelist item -- I need it to be the display name.

2.) Now my Crawling logs are filled with:

WARN You have specified both IncludeTemplates and ExcludeTemplates. This logic is not supported. Exclude templates will be ignored.

This is what I have for my indexing configuration, but evidently I have something incorrect:

<index id="knowledge_center_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
    <param desc="name">$(id)</param>
    <param desc="folder">$(id)</param>
    <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
    <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration">
        <include hint="list:IncludeTemplate">
            <generalTemplatePage>{AD63DB1D-A3A5-4D16-9F19-7D878BBE2568}</generalTemplatePage>
            <newsPage>{85901309-D07C-447B-97DA-EA6F1581832C}</newsPage>
            <inTheNewsPage>{C49A9219-231D-42C6-AED2-9115CC241247}</inTheNewsPage>
        </include>
        <IndexAllFields>true</IndexAllFields>
        <fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
            <fieldNames hint="raw:AddFieldByFieldName">
                <fieldType fieldName="tags" storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
            </fieldNames>
        </fieldMap>
    </configuration>
    <strategies hint="list:AddStrategy">
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/remoteRebuild" />
    </strategies>
    <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
        <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
        </policies>
    </commitPolicyExecutor>
    <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>web</Database>
            <Root>/sitecore/content/Sites/My Site/Knowledge Center</Root>
        </crawler>
    </locations>
</index>

UPDATE: @Marek Musielak -- For #1, I followed the link you pointed to in your answer and am getting this kind of error over and over in my Crawling.logs:

6272 12:49:18 ERROR Could not compute value for ComputedIndexField: potential for indexable: sitecore://master/{2D06E798-6BFE-4089-A610-5C341BF28B09}?lang=en&ver=3 Exception: System.Reflection.TargetInvocationException Message: Exception has been thrown by the target of an invocation. Source: mscorlib at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert) at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) at Sitecore.Analytics.Reporting.ReportingQueryBase..ctor(ReportDataProviderBase reportProvider, CachingPolicy cachingPolicy) at Sitecore.ContentTesting.Analytics.Reporting.TestPotentialQuery..ctor(ReportDataProviderBase reportProvider) at Sitecore.ContentTesting.ContentSearch.ComputedIndexFields.TestPotentialMetricBase.ComputeFieldValue(IIndexable indexable) at Sitecore.ContentSearch.LuceneProvider.LuceneDocumentBuilder.AddComputedIndexFields()

Nested Exception

Exception: System.Reflection.TargetInvocationException Message: Exception has been thrown by the target of an invocation. Source: mscorlib at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert) at Sitecore.Analytics.Reports.StimulsoftIntegration.BuiltInFunctionsReportDataSource..ctor()

Nested Exception

Exception: System.InvalidOperationException Message: Cannot use DataAdapterProvider as Analytics is disabled. Source: Sitecore.Analytics.MongoDB at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider..ctor(Func`2 driverFactory)

Why does it care if Analytics is disabled?


UPDATE 2: @Rogier

I needed to move the fieldMap into the defaultLuceneIndexConfiguration:

<defaultLuceneIndexConfiguration type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, Sitecore.ContentSearch.LuceneProvider">
<fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
    <fieldNames hint="raw:AddFieldByFieldName">
        <field patch:before="field[0]" fieldName="tags" storageType="YES" indexType="UNTOKENIZED" vectorType="NO" boost="1f" type="System.String" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />
    </fieldNames>
</fieldMap>
<fields hint="raw:AddComputedIndexField">
    <field patch:before="field[0]" fieldName="tags">MyNamespace.Search.ComputedFields, MyNamespace.Search</field>
</fields>

The main index patch ended up looking like:

<index id="knowledge_center_index" type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
    <param desc="name">$(id)</param>
    <param desc="folder">$(id)</param>
    <!-- This initializes index property store. Id has to be set to the index id -->
    <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
    <configuration ref="contentSearch/indexConfigurations/defaultLuceneIndexConfiguration">
        <include hint="list:IncludeTemplate">
            <generalTemplatePage>{AD63DB1D-A3A5-4D16-9F19-7D878BBE2568}</generalTemplatePage>
            <newsPage>{85901309-D07C-447B-97DA-EA6F1581832C}</newsPage>
            <inTheNewsPage>{C49A9219-231D-42C6-AED2-9115CC241247}</inTheNewsPage>
        </include>
        <IndexAllFields>true</IndexAllFields>
    </configuration>
    <strategies hint="list:AddStrategy">
        <!-- NOTE: order of these is controls the execution order -->
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/remoteRebuild" />
    </strategies>
    <commitPolicyExecutor type="Sitecore.ContentSearch.CommitPolicyExecutor, Sitecore.ContentSearch">
        <policies hint="list:AddCommitPolicy">
            <policy type="Sitecore.ContentSearch.TimeIntervalCommitPolicy, Sitecore.ContentSearch" />
        </policies>
    </commitPolicyExecutor>
    <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>web</Database>
            <Root>/sitecore/content/Sites/My Site/Knowledge Center</Root>
        </crawler>
    </locations>

I hope this is helpful...

1
Can you look in Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config and see if "<exclude hint=........" is set there. You can also look in /sitecore/admin/showconfig.aspx and look for it there.Chris Auer
Did you ever fix the problem Cannot use DataAdapterProvider as Analytics is disabled listed in your update? We've got the same one. My Google-Fu is failing me, though: Can't find any possible causes online.Rogier van het Schip
@RogiervanhetSchip I added another update that will hopefully help you out.eat-sleep-code

1 Answers

1
votes

Ad 1):

By default Sitecore indexes ids of the chosen items. The reason for that is simple: lets assume for a second that Sitecore stores names of the tags. Imagine that you've chosen TagA and TagB for MyArticle item. Sitecore indexes your MyArticle item, and saves TagA and TagB values in the index. Now you renamed TagA to Other TagA. Sitecore doesn't re-crawl your MyArticle cause it hasn't changed (only tag item changed). So your MyArticle item has incorrect values in index - it's still TagA there.

Sure, if you know that you'll NEVER change name (or display name) of any of your tags, you can easily create a computed field, which will keep item display names. There is example how you can do this in this blog post: Computed index field for MultiList type field

Ad 2):

Just go to the /sitecore/admin/showconfig.aspx page and check if there is any place with ExcludeTemplate defined. Then trace that entry in your App_Config\Include folder and voila.