# Sitecore Elastic Search

In Sitecore (Sitecore 9) to get search results from different-2 third party systems including Sitecore, we need to use Elastic search instead of default Solr search in Sitecore 9. Is my understanding is correct or not?

Also, the Sitecore 9 required the Solr but to implement Elastic search we need to setup Elastic search as mentioned at https://joaoneto.blog/2017/05/16/how-to-add-elasticsearch-to-your-sitecore-part-i/

In this case we need to install Solr or not and Is the above installation guide will be valid for SC9?

• Are you asking if you can index 3rd party data in Solr along side the Sitecore content? – Richard Seal Jul 16 '18 at 17:21
• You can create a custom crawler to index data from wherever. Perhaps that would meet the need? – Michael West Jul 16 '18 at 20:21
• @Richard: You are correct. I wanted to index 3rd party data with Sitecore content. – Amit Kumar Jul 17 '18 at 1:20
• @Michael: Let me search this topic and check the feasibility. – Amit Kumar Jul 17 '18 at 1:21

As I see this you have a few options. I disagree with @jflheureux that Solr is not a good fit for this. Solr is perfect for this, it is what it is designed for.

The options would be:

1. Create a new custom index to store both Sitecore content and the 3rd party data. This can use Solr or Azure Search (Don't bother with Lucene, that is really for local development only)
• Pro: This would be easier to specify the fields required that match across both datasets and it would not clutter the data with extra content from Sitecore that you do not need
• Pro: You would need to access the Solr data direct through Solr.net not the Sitecore Search API, so you have more flexibility in the queries that you write.
• Con: You would need to access the Solr data direct through Solr.net not the Sitecore Search API, so you would need to write your own query layer.
• Con: You would have to implement 2 crawlers, one for the Sitecore content and one for the 3rd party. Although this should not be that complex to do. You would also need 2 versions of this index, for master and web content from Sitecore.
2. Extend the Sitecore indexes to include the 3rd party data and just use those indexes.
• Pro: Only 1 crawler would need to be written
• Pro: You can use the Sitecore Search API
• Con: You would have to structure your 3rd party data to mimic a Sitecore item and that could get really tricky. I would not recommend this approach
3. Use Coveo for Sitecore
• Pro: Its a supported 3rd party option that is commercial and has some connectors for 3rd party data (It might not have the one you need tho).
• Pro: There are some nice components already written
• Con: Its only really for Site Search, if you need to use this content in code for lookup's etc... it might not be the best option
• Con: There is a cost for this, it is a commercial product and can get expensive depending on your traffic level.
4. Elastic Search
• Con: IMO there is no advantage to using this, you still have to maintain Solr or Azure Search for the main indexes, so why add the extra overhead of maintaining another search engine. Other than that, this option would be the same process as option 1.

I know I haven't directly answered your question by stating you should use a particular method. The answer is "it depends" - you have to look at your infrastructure, your requirements and your experience with these technologies and decide what is the best option for you and your client.

• Thanks Richard. I have to explore both the options but it really helps to identify the suitable approach. – Amit Kumar Jul 17 '18 at 16:01

You are correct to say that querying more than one source of content for website search purposes with Lucene or Solr as used by Sitecore is very hard, or not possible.

You are also correct to say that a unified index is the solution to this problem. There are multiple unified index products that could solve this problem:

• Elastic Search. No integration in Sitecore. Runs on your premises, you manage the servers and services. You have to code everything to index and query Sitecore items and third-party data.
• Coveo for Sitecore. Commercial product fully integrated in Sitecore. Hosted in the cloud and offered as a service (SaaS). No code required to integrate in Sitecore or crawl third-party data as it has dozens of connectors for enterprise grade third-party systems.

In both cases, you probably do not want to switch from Lucene/Solr to the chosen unified index. Lucene/Solr is used extensively by many Sitecore administrative tools and manages many indices. Switching all of them would be a tedious task.

I recommend you index only the required Sitecore items and third-party data in the unified index and use it for your website search needs. Leaving Lucene/Solr in place for out of the box Sitecore functionality.

As for the Elastic Search installation guide validity for Sitecore 9, I do not know. You are better to leave a comment to the author.

Disclaimer: I work for Coveo and I am not against other search solutions. Each solution fits different needs.

• Thanks for the detailed information. It means Solr/Lucene would be required for OOTB functionality and Elastic search/Coveo search along with Solr/Lucene can be used to integrate 3rd party data and Sitecore data. – Amit Kumar Jul 17 '18 at 1:25