Arbejdsglæde
Arbejdsglæde

Reputation: 14088

Sitecore Solr Index Configuration Set different root path

I need add to single Solr index 2 different sitecore path /sitecore/content/System/My Path and /sitecore/content/System/My Path 2.

How I can do it in correct way ?

Should I just add new crawler description to locations section with new root value. Should I use | spliter at root section ? Or need I copy all index section with new path in root ?

<index id="my_index" type="Sitecore.ContentSearch.SolrProvider.SwitchOnRebuildSolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
    <param desc="name">$(id)</param>
    <param desc="core">myindex</param>
    <param desc="rebuildcore">myindex_swap</param>
    <param desc="propertyStore" ref="contentSearch/databasePropertyStore" param1="$(id)" />
    <configuration ref="contentSearch/indexConfigurations/countryIndexConfiguration" />
    <strategies hint="list:AddStrategy">
        <strategy ref="contentSearch/indexUpdateStrategies/manual" />
    </strategies>
    <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
            <Database>web</Database>
            <Root>/sitecore/content/System/My Path</Root>
        </crawler>                          
    </locations>
</index>

Upvotes: 3

Views: 1416

Answers (2)

Naresh Geepalem
Naresh Geepalem

Reputation: 11

We are using multiple tags with same name as crawler under locations and its working fine. It supports multiple tags with same name.

Upvotes: 1

Marek Musielak
Marek Musielak

Reputation: 27132

Just copy crawler and use different tag name than the original one, e.g. crawler1. It doesn't matter what's the tag name, so you can use some more specific tag names, e.g. news or blogs. The important thing is that you can not have 2 tags with the same name under locations tag.

Sample config with 2 roots:

<locations hint="list:AddCrawler">
    <news type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>web</Database>
        <Root>/sitecore/content/System/news</Root>
    </news>                          
    <blogs type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>web</Database>
        <Root>/sitecore/content/System/blogs</Root>
    </blogs>                          
</locations>

Upvotes: 3

Related Questions