# How to Install two search engines in one site

**URL:** https://discuss.elastic.co/t/how-to-install-two-search-engines-in-one-site/200167
**Category:** Elastic Search
**Tags:** elastic-site-search
**Created:** [September 19, 2019, 9:29am UTC](https://discuss.elastic.co/t/how-to-install-two-search-engines-in-one-site/200167 "2019-09-19T09:29:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Carlos\_Lozada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_lozada/32/51130_2.png) [@Carlos\_Lozada](https://discuss.elastic.co/u/Carlos_Lozada)
#### Post date: [September 19, 2019, 9:29am UTC](https://discuss.elastic.co/t/how-to-install-two-search-engines-in-one-site/200167/1 "2019-09-19T09:29:09Z")

</div>

Hello Guys,  
I have created two search engines on site-search each specific to the corresponding sitemaps according to the language of the search  
Engine Search for Spanish looking only at the sitemaps for Spanish  
Engine Search for English looking only at the sitemaps for English

This has been done correctly, now the problem resides to install it on my e-commerce  
I have tried using both scripts given but I got the error message to install only one

So I did it in this way

`<!-- Swiftype -->`  
`<script type="text/javascript">`  
` (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){`  
` (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);`  
` e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);`  
` })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');`

`if (window.location.href.indexOf('/es') !== -1) {`  
` _st('install', '<CODE-ES>', '2.0.0');`  
`} else if (window.location.href.indexOf('/en-ie') !== -1) {`  
` _st('install','<CODE-EN>', '2.0.0');`  
`}`

`</script>`  
`<!-- End Swiftype -->`

Now I only get the search result in one of the two engines added and according to the Url were I'm at  
For example:  
If I'm in /es give me results for Spanish (this is Ok as my main language for the store)  
if I'm/en-ie give me results for English:

Thanks for your time

---

<div class="post-metadata">

### Author: ![qhoxie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/qhoxie/32/47252_2.png) [@qhoxie](https://discuss.elastic.co/u/qhoxie)
#### Post date: [September 19, 2019, 3:25pm UTC](https://discuss.elastic.co/t/how-to-install-two-search-engines-in-one-site/200167/2 "2019-09-19T15:25:45Z")

</div>

Hello,

At a glance, I think this will work. What error message are you getting?

Best,  
Quin

---

<div class="post-metadata">

### Author: ![Carlos\_Lozada](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_lozada/32/51130_2.png) [@Carlos\_Lozada](https://discuss.elastic.co/u/Carlos_Lozada)
#### Post date: [September 20, 2019, 9:04am UTC](https://discuss.elastic.co/t/how-to-install-two-search-engines-in-one-site/200167/3 "2019-09-20T09:04:56Z")

</div>

Hi,  
I was getting an error when adding both scripts in full which was now avoided using it in the way showed above. So, no Errors now and working fine, I decided to share the way, but if there's any other one better than this I'm open for improvements 🙂

Kind regards,  
Carlos

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 18, 2019, 9:04am UTC](https://discuss.elastic.co/t/how-to-install-two-search-engines-in-one-site/200167/4 "2019-10-18T09:04:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
