One Algolia account, two Zendesk?

I’ve got two Zendesk accounts, one for staging, one for production.

I have created two indexes, one for zendesk_production-subdomain_articles and one for zendesk_staging-subdomain_articles

I’ve created a search-only API key for staging and assigned it access to that index.

If I search on staging, I don’t get results sent back, however if I cancel the search, I can see the 4 entries I manually inserted in to the staging index.

Is there support for what I’m trying to do here?

Here’s the code I have in place. Works great in production.

{{# is help_center.name 'Staging Site Name'}}
<meta name="robots" content="noindex" />{{/ is }}
<!-- begin algolia search -->
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/algoliasearch.zendesk-hc/2/algoliasearch.zendesk-hc.min.css">
<script type="text/javascript" src="//cdn.jsdelivr.net/algoliasearch.zendesk-hc/2/algoliasearch.zendesk-hc.min.js"></script>
<script type="text/javascript">
  algoliasearchZendeskHC({
    applicationId: 'ALG_ACCOUNT_ID',
    apiKey: '233e055fREDACTEDe2f4542bb6',
    subdomain: 'staging-subdomain'
  });
</script>
<!-- end algolia search -->
{{/ is }}

{{# is help_center.name 'Production Site Name'}}

<!-- begin alogia search -->
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/algoliasearch.zendesk-hc/2/algoliasearch.zendesk-hc.min.css">
<script type="text/javascript" src="//cdn.jsdelivr.net/algoliasearch.zendesk-hc/2/algoliasearch.zendesk-hc.min.js"></script>
<script type="text/javascript">
  algoliasearchZendeskHC({
    applicationId: 'ALG_ACCOUNT_ID',
    apiKey: 'NORMAL_API_SEARCH_KEY',
    subdomain: 'production-subdomain'
  });
</script>
<!-- end alogia search -->
{{/ is }}

Could you expand a bit more about what you mean by “cancelling the search”?
Also, could you provide us with the settings you used for the new API key you created?

1 Like

Repro:

  • visit the staging site

  • perform a search (for widgets in this example)

  • get no results (on /hc/en-us/search?utf8=✓&query=widgets

    2018-08-22_09-16-46

  • click “clear your filters

  • land at /hc/en-us/search?query=widgets&hPP=20&idx=zendesk_staging-subdomain_articles&p=0&utf8=%E2%9C%93&is_v=1

View a list of results. (9 words found in 4 articles)

Here is a screenshot of the key’s setup:

Great catch! The initial load without result is actually expected.
What happened is that when you click “clear your refinements”, we removed every single filter.

However, we do set a filter on your current locale (en-us) when you load the search page, and hence were removing it, when we should have instead kept it.
I’ve just deployed a fix for this, which you should see propagated on your site in the next few days.

My belief is that your articles on your staging environment are published with another locale, and that it’s expected that you don’t see results when loading.

1 Like

Since you’ve contacted us via email with your Help Center URL, let’s keep this discussion over there.
I’ll make sure to update this thread with the resolution.

1 Like

The main issue was related to the fact that our UI is unclear when you have multiple connectors.
The thing you’ll see displayed should be like this:

image

Those are two different tabs, each of them representing a connector.

1 Like

To recap for posterity:

There is native support for >1 zendesk connector. I opened this issue after changes we’d made internally fouled things up.

We are also able to use 1 git repo to track a single theme for use on staging & production environments by using an if statement based on the Support Center Name

{{# is help_center.name 'Production Site Name'}}
  [code for prod]
{{/ is }}

{{# is help_center.name 'Staging Site Name'}}
  [code for staging]
{{/ is }}

This example came from the Algolia team, and I use it to include a

 <meta name="robots" content="noindex" />

in our staging, site but not production, all in the same document_head.hbs

Thanks for the great support on this!

1 Like