How to configure seperate solr index for multi site in a single instance in sitecore?












1















I have 2 websites configured in a single instance, where i wanted to configure separate search indexes of solr for each website.










share|improve this question























  • Your SOLR indexes are build depending on your instance name, you can have 1 SOLR server and multiple sites hosted with the respective indexes for the different sites. i.e site1_ , site2_ site3_ etc

    – Sitecore Sam
    Jan 28 at 12:34
















1















I have 2 websites configured in a single instance, where i wanted to configure separate search indexes of solr for each website.










share|improve this question























  • Your SOLR indexes are build depending on your instance name, you can have 1 SOLR server and multiple sites hosted with the respective indexes for the different sites. i.e site1_ , site2_ site3_ etc

    – Sitecore Sam
    Jan 28 at 12:34














1












1








1








I have 2 websites configured in a single instance, where i wanted to configure separate search indexes of solr for each website.










share|improve this question














I have 2 websites configured in a single instance, where i wanted to configure separate search indexes of solr for each website.







solr






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 28 at 12:02









EswarEswar

63




63













  • Your SOLR indexes are build depending on your instance name, you can have 1 SOLR server and multiple sites hosted with the respective indexes for the different sites. i.e site1_ , site2_ site3_ etc

    – Sitecore Sam
    Jan 28 at 12:34



















  • Your SOLR indexes are build depending on your instance name, you can have 1 SOLR server and multiple sites hosted with the respective indexes for the different sites. i.e site1_ , site2_ site3_ etc

    – Sitecore Sam
    Jan 28 at 12:34

















Your SOLR indexes are build depending on your instance name, you can have 1 SOLR server and multiple sites hosted with the respective indexes for the different sites. i.e site1_ , site2_ site3_ etc

– Sitecore Sam
Jan 28 at 12:34





Your SOLR indexes are build depending on your instance name, you can have 1 SOLR server and multiple sites hosted with the respective indexes for the different sites. i.e site1_ , site2_ site3_ etc

– Sitecore Sam
Jan 28 at 12:34










1 Answer
1






active

oldest

votes


















7














Even if you have multiple sites on the same Sitecore instance, you can have only a single Solr Server with different cores.



First, you need to create a custom solr index configuration file for each site. Example:



For Site A



<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="sitecore_web_index_site_a" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">$(id)</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content/Site A</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>


For Site B



<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="sitecore_web_index_site_b" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">$(id)</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
<Database>web</Database>
<Root>/sitecore/content/Site B</Root>
</crawler>
</locations>
<enableItemLanguageFallback>false</enableItemLanguageFallback>
<enableFieldLanguageFallback>false</enableFieldLanguageFallback>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>


Second, once you have your configuration files setup, you need to create the cores of those sites on the Solr Server with the same name as you mentioned in the configuration file. Based on the configuration snippet above, the cores in Solr will be named: sitecore_web_index_site_a and sitecore_web_index_site_b.



Note that you need to change the root of the crawler so that it points to the Site path. Moreover, you can take the Sitecore default solr indexes for master, web and core as an example.






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "664"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f16272%2fhow-to-configure-seperate-solr-index-for-multi-site-in-a-single-instance-in-site%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7














    Even if you have multiple sites on the same Sitecore instance, you can have only a single Solr Server with different cores.



    First, you need to create a custom solr index configuration file for each site. Example:



    For Site A



    <?xml version="1.0" encoding="utf-8" ?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
    <contentSearch>
    <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
    <indexes hint="list:AddIndex">
    <index id="sitecore_web_index_site_a" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
    <param desc="name">$(id)</param>
    <param desc="core">$(id)</param>
    <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
    <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
    <strategies hint="list:AddStrategy">
    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
    </strategies>
    <locations hint="list:AddCrawler">
    <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
    <Database>web</Database>
    <Root>/sitecore/content/Site A</Root>
    </crawler>
    </locations>
    <enableItemLanguageFallback>false</enableItemLanguageFallback>
    <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
    </index>
    </indexes>
    </configuration>
    </contentSearch>
    </sitecore>
    </configuration>


    For Site B



    <?xml version="1.0" encoding="utf-8" ?>
    <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
    <sitecore>
    <contentSearch>
    <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
    <indexes hint="list:AddIndex">
    <index id="sitecore_web_index_site_b" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
    <param desc="name">$(id)</param>
    <param desc="core">$(id)</param>
    <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
    <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
    <strategies hint="list:AddStrategy">
    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
    </strategies>
    <locations hint="list:AddCrawler">
    <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
    <Database>web</Database>
    <Root>/sitecore/content/Site B</Root>
    </crawler>
    </locations>
    <enableItemLanguageFallback>false</enableItemLanguageFallback>
    <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
    </index>
    </indexes>
    </configuration>
    </contentSearch>
    </sitecore>
    </configuration>


    Second, once you have your configuration files setup, you need to create the cores of those sites on the Solr Server with the same name as you mentioned in the configuration file. Based on the configuration snippet above, the cores in Solr will be named: sitecore_web_index_site_a and sitecore_web_index_site_b.



    Note that you need to change the root of the crawler so that it points to the Site path. Moreover, you can take the Sitecore default solr indexes for master, web and core as an example.






    share|improve this answer




























      7














      Even if you have multiple sites on the same Sitecore instance, you can have only a single Solr Server with different cores.



      First, you need to create a custom solr index configuration file for each site. Example:



      For Site A



      <?xml version="1.0" encoding="utf-8" ?>
      <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
      <contentSearch>
      <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
      <indexes hint="list:AddIndex">
      <index id="sitecore_web_index_site_a" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
      <param desc="name">$(id)</param>
      <param desc="core">$(id)</param>
      <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
      <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
      <strategies hint="list:AddStrategy">
      <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
      </strategies>
      <locations hint="list:AddCrawler">
      <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
      <Database>web</Database>
      <Root>/sitecore/content/Site A</Root>
      </crawler>
      </locations>
      <enableItemLanguageFallback>false</enableItemLanguageFallback>
      <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>
      </indexes>
      </configuration>
      </contentSearch>
      </sitecore>
      </configuration>


      For Site B



      <?xml version="1.0" encoding="utf-8" ?>
      <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
      <sitecore>
      <contentSearch>
      <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
      <indexes hint="list:AddIndex">
      <index id="sitecore_web_index_site_b" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
      <param desc="name">$(id)</param>
      <param desc="core">$(id)</param>
      <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
      <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
      <strategies hint="list:AddStrategy">
      <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
      </strategies>
      <locations hint="list:AddCrawler">
      <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
      <Database>web</Database>
      <Root>/sitecore/content/Site B</Root>
      </crawler>
      </locations>
      <enableItemLanguageFallback>false</enableItemLanguageFallback>
      <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
      </index>
      </indexes>
      </configuration>
      </contentSearch>
      </sitecore>
      </configuration>


      Second, once you have your configuration files setup, you need to create the cores of those sites on the Solr Server with the same name as you mentioned in the configuration file. Based on the configuration snippet above, the cores in Solr will be named: sitecore_web_index_site_a and sitecore_web_index_site_b.



      Note that you need to change the root of the crawler so that it points to the Site path. Moreover, you can take the Sitecore default solr indexes for master, web and core as an example.






      share|improve this answer


























        7












        7








        7







        Even if you have multiple sites on the same Sitecore instance, you can have only a single Solr Server with different cores.



        First, you need to create a custom solr index configuration file for each site. Example:



        For Site A



        <?xml version="1.0" encoding="utf-8" ?>
        <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
        <contentSearch>
        <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
        <indexes hint="list:AddIndex">
        <index id="sitecore_web_index_site_a" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
        <param desc="name">$(id)</param>
        <param desc="core">$(id)</param>
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
        <strategies hint="list:AddStrategy">
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        </strategies>
        <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>web</Database>
        <Root>/sitecore/content/Site A</Root>
        </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
        </index>
        </indexes>
        </configuration>
        </contentSearch>
        </sitecore>
        </configuration>


        For Site B



        <?xml version="1.0" encoding="utf-8" ?>
        <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
        <contentSearch>
        <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
        <indexes hint="list:AddIndex">
        <index id="sitecore_web_index_site_b" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
        <param desc="name">$(id)</param>
        <param desc="core">$(id)</param>
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
        <strategies hint="list:AddStrategy">
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        </strategies>
        <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>web</Database>
        <Root>/sitecore/content/Site B</Root>
        </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
        </index>
        </indexes>
        </configuration>
        </contentSearch>
        </sitecore>
        </configuration>


        Second, once you have your configuration files setup, you need to create the cores of those sites on the Solr Server with the same name as you mentioned in the configuration file. Based on the configuration snippet above, the cores in Solr will be named: sitecore_web_index_site_a and sitecore_web_index_site_b.



        Note that you need to change the root of the crawler so that it points to the Site path. Moreover, you can take the Sitecore default solr indexes for master, web and core as an example.






        share|improve this answer













        Even if you have multiple sites on the same Sitecore instance, you can have only a single Solr Server with different cores.



        First, you need to create a custom solr index configuration file for each site. Example:



        For Site A



        <?xml version="1.0" encoding="utf-8" ?>
        <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
        <contentSearch>
        <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
        <indexes hint="list:AddIndex">
        <index id="sitecore_web_index_site_a" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
        <param desc="name">$(id)</param>
        <param desc="core">$(id)</param>
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
        <strategies hint="list:AddStrategy">
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        </strategies>
        <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>web</Database>
        <Root>/sitecore/content/Site A</Root>
        </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
        </index>
        </indexes>
        </configuration>
        </contentSearch>
        </sitecore>
        </configuration>


        For Site B



        <?xml version="1.0" encoding="utf-8" ?>
        <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <sitecore>
        <contentSearch>
        <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
        <indexes hint="list:AddIndex">
        <index id="sitecore_web_index_site_b" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
        <param desc="name">$(id)</param>
        <param desc="core">$(id)</param>
        <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
        <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
        <strategies hint="list:AddStrategy">
        <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
        </strategies>
        <locations hint="list:AddCrawler">
        <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
        <Database>web</Database>
        <Root>/sitecore/content/Site B</Root>
        </crawler>
        </locations>
        <enableItemLanguageFallback>false</enableItemLanguageFallback>
        <enableFieldLanguageFallback>false</enableFieldLanguageFallback>
        </index>
        </indexes>
        </configuration>
        </contentSearch>
        </sitecore>
        </configuration>


        Second, once you have your configuration files setup, you need to create the cores of those sites on the Solr Server with the same name as you mentioned in the configuration file. Based on the configuration snippet above, the cores in Solr will be named: sitecore_web_index_site_a and sitecore_web_index_site_b.



        Note that you need to change the root of the crawler so that it points to the Site path. Moreover, you can take the Sitecore default solr indexes for master, web and core as an example.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 28 at 12:49









        Hishaam NamooyaHishaam Namooya

        6,6291627




        6,6291627






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Sitecore Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsitecore.stackexchange.com%2fquestions%2f16272%2fhow-to-configure-seperate-solr-index-for-multi-site-in-a-single-instance-in-site%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$