Gravatar for ben.stichter@fotf.org

Question by bstichter, Feb 3, 2018 4:26 PM

Automatically search all external sources in Hive framework (Coveo for Sitecore)

I want a tab that just searches ALL external sources so that if Coveo administrators add new sources, the "All Sites" tab will automatically pick up the results without needing to remember to update the Sitecore search page. Is this possible? I'm using Hive framework.

2 Replies
Gravatar for flguillemette@coveo.com

Answer by François Lachance-Guillemette, Feb 6, 2018 1:18 PM

An alternate solution would be to remove all the expressions added by Coveo for Sitecore and instead switch to exclude the `master` index when you are in `web`.

The logic would be the following:

if in a master context, `@syssource<>"coveo_web_index"`, if in a web context, `@syssource<>"coveo_master_index"`.

Note that if you have a `pub` index for publishing, it will require you to add a new rule for this index and exclude the `pub` index in the two other contexts.

Gravatar for ben.stichter@fotf.org

Comment by bstichter, Feb 6, 2018 7:27 PM

Ooh... I like this idea. I'm going to explore this. How do I remove the expressions added by Coveo for Sitecore. I assume these are the filters I add once the defaults are removed, but I'm not sure how to remove the defaults...

Gravatar for ben.stichter@fotf.org

Comment by bstichter, Feb 6, 2018 7:27 PM

Ooh... I like this idea. I'm going to explore this. How do I remove the expressions added by Coveo for Sitecore. I assume these are the filters I add once the defaults are removed, but I'm not sure how to remove the defaults...

Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Feb 5, 2018 2:35 PM

Hi,

This is not possible with Coveo for Sitecore. It is due to the fact that Coveo for Sitecore automatically adds an advanced query expression for the Sitecore source to query (master/web). There is no way to configure Coveo for Sitecore not to add this query expression, thus,it requires all external sources to be added one by one in Coveo for Sitecore.

With a lot of coding, you could create a custom solution:

  1. Write a Sitecore job that calls the Coveo index to list all sources. This job would cache the sources to add to your tab. Pay attention not to execute this job too often. Once every few hours should be enough.
  2. Write a custom Sitecore rendering that would generate the required JavaScript code to add all the cached sources to the query expression. You would use this component on your tab.
Ask a question