Gravatar for dipsindol@gmail.com

Question by DEEPTHI KATTA, Jan 10, 2017 1:13 AM

Change database name on Coveo_web_Index

Is it recommended to swap the database name for CoveoWebIndex. We have different naming convention and demand for this to be a different string other than web. We have a different connectionstring that we would like to point it to. How can I patch the database name and crawler locations as well. Basically looking for a correct and proper way of handling this. Definitely, we do not want to edit the Coveo.SearchProvider.Config and would like to pull this change on custom.config.

Thoughts???

2 Replies
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Jan 10, 2017 12:03 PM

Hi @Dipsindol :)

Have you tried creating this patch file?

I tried it out with an OOTB configuration plus this patch file:

<configuration><sitecore>
<contentSearch>
  <configuration>
    <indexes hint="list:AddIndex">
      <index id="Coveo_web_index" type="Coveo.SearchProvider.ProviderIndex, Coveo.SearchProvider" patch:before = "*[2]">
        <locations hint="list:AddCrawler">
          <crawler name="ContentCrawler" type="Coveo.SearchProvider.CoveoItemCrawler, Coveo.SearchProviderBase">
            <database>YOUR_DATABASE</database>
          </crawler>
          <crawler name="MediaLibraryCrawler" type="Coveo.SearchProvider.CoveoItemCrawler, Coveo.SearchProviderBase">
            <database>YOUR_DATABASE</database>
          </crawler>
        </locations>
      </index>
    </indexes>
  </configuration>
</contentSearch>
</sitecore></configuration>

And here is the result:

<crawler name="ContentCrawler" type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
    <database>YOUR_DATABASE</database>
    <root>/sitecore/content</root>
    <stopOnError>true</stopOnError>
</crawler>

Sitecore automatically merges single values text nodes if their parents are the same. Copy-paste the nodes from Coveo.SearchProvider.config, remove what you don't want to change, and ensure your patch file is inserted after Coveo.SearchProvider.config and it should work fine.

Gravatar for dberube@coveo.com

Answer by Dominic Berube, Jan 10, 2017 12:09 PM

Hi,

You can patch the database name and crawler location by specifying the crawler name in your patch file:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <contentSearch>
      <configuration>
        <indexes>
          <index id="Coveo_web_index">
            <locations>
              <crawler name="ContentCrawler">
                <database>my_custom_db</database>
                <root>/sitecore/content/my_root_path</root>
              <crawler>
            </locations>
          </index>
        </indexes>
      </onfiguration>
    </contentSearch>
  </sitecore>
</configuration>

Dom

Gravatar for dipsindol@gmail.com

Comment by DEEPTHI KATTA, Jan 10, 2017 12:56 PM

Thank you both. :) I was going to try patching today. But, I guess my concern was -

  1. Is it okay to modify the database name on core indexes OOTB indexes that come with Coveo install? Just wanted to make sure it does not cause any unknown side effects especially because Lucene is still on.
  2. I am really curious to know if there is way which index and database Coveo is looking for on Live site? For example, we have two connection strings that point to CD server database, I want to know which one Coveo would pick by default when we load the site? Any thoughts and internal logic around this will help me greatly make these decisions.
Gravatar for dipsindol@gmail.com

Comment by DEEPTHI KATTA, Jan 13, 2017 12:47 AM

So, in my situation it made sense to have additional index that points to different database on our CD servers. For any one else who is looking for answers. Once we create additional index on CM and CD's based on database of our interest. Ensure your site node points to database on which this index is based on. Coveo by default seems to pick the site context db as assigned in site config. :)

That did it.

Ask a question