Robert Pouleijn
Robert Pouleijn

Reputation: 509

How to index Multilist with lucene

In our template we defined a Multilist field. We added this field to the Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config file:

<field fieldName="apps_or"                storageType="YES"  indexType="TOKENIZED"    vectorType="NO" boost="1f" type="System.GUID" settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">

Why is this necessary when it says <IndexAllFields>true</IndexAllFields> in this file anyway?

After we added this line and published all content we see the field appearing in the Overview tab of the Luke tool. But in the Documents tab the field is still missing. Also when we do a Content search on the web index using .Net the field is always null:

class NewsSearchResultItem : SearchResultItem
{
    public string Title { get; set; }
    public string Body { get; set; }
    public string Introduction { get; set; }

    [IndexField("apps_or")]
    public IEnumerable<ID> AppIdOr { get; set; }

}

apps_or is the name of the index as it appears in the Luke tool. Any ideas how to properly get the field in the index and have it available through .Net??

Many thanks in advance Robert

Upvotes: 0

Views: 1376

Answers (1)

Robert Pouleijn
Robert Pouleijn

Reputation: 509

You are right femtoRgon! It was indexed but not stored, apparently you have to enable storing multilist fields in the same config file:

<fieldType fieldTypeName="multilist"                          storageType="YES" indexType="TOKENIZED" vectorType="NO" boost="1f" type="System.String"   settingType="Sitecore.ContentSearch.LuceneProvider.LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider" />

Upvotes: 2

Related Questions