If we already have a relational database, then why should we use Solr? It's simple; if there is a use case that needs you to search, you need a search engine platform like Solr. There are various use cases that we will be discussing further in the chapter.
Databases and Solr have their own pros and cons. In one place where we use a database, SQL supports limited wildcard-based text search with some basic normalization, such as matching uppercase to lowercase. It might be a costly query as it does full table scans. Whereas in Solr, a searchable word index is stored in an inverse index, which is much faster than traditional database searches.
Let's look at the following diagram to understand this better:
Having an enterprise search engine solution is must for an organization nowadays, it is having a prominent role in the aspect of getting information quickly with the help of searches. Not having such a search engine platform can result in insufficient information, inefficiency of productivity, and additional efforts due to duplication of work. Why? Just because of not having the right information available quickly, without a search; it is something that we can't even think of. Most such use cases comprise the following key requirements:
- Data collected should be parsed and indexed. So, parsing and indexing is one of the important requirements of any enterprise search engine platform.
- A search should provide the required results almost at runtime on the required datasets. Performance and relevance are two more key requirements.
- The search engine platform should be able to crawl or collect all of the data that it would require to perform the search.
- Integration of the search engine along with administration, monitoring, log management, and customization is something that we would be expecting.
Solr has been designed to have a powerful and flexible search that can be used by applications; whenever you want to serve data based on search patterns, Solr is the right fit.
Here is a high-level diagram that shows how Solr is integrated with an application:
The majority of popular websites, including many Intranet websites, have integrated search solutions to help users find relevant information quickly. User experience is a key element for any solution that we develop; and searching is one of the major features that cannot be ignored when we talk about user experience.