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