Let's fist discuss the Problem with the SQL “like” clause
And Solr has all these. Solr is a framework which is built on the top of lucane.It is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, a web administration interface .
However Hibernate Search module also provides index based search capabilities.Below are pros and cons for Solr and Hibernate we should keep in mind while taking our decsion judiously.
Solr:
Apache Solr will be useful when
Hibernate Search:
Earlier Twitter was using MySQL backened for giving the search result.When they moved to real-time version of Lucene, there was a considerable gain in the performance.
Twitter application rely on Solr/lucene for the Real-time indexes, Top tweet indexes,Geo indexes.
Will discuss more in detail in the next blog on Solr with sample example/code.
- It is very slow, database does a simple brute-force search.
- There is no concept of relevancy (match score)
- It is too literal. it may match parts of words when you only wanted to match whole words.
- Text analysis
- Relevancy ranking:
- zaceted navigation:
- Query features & syntax:From boolean logic to grouping to phrases to fuzzy-searches, to score boosting.
- Result highlighting:
- Query spell correction (i.e. “did you mean”)
- Term-suggest (AKA search auto-complete)
- Sub-string indexing:
- Geo-location search:
- Field/facet suggestions
- Clustering:
And Solr has all these. Solr is a framework which is built on the top of lucane.It is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, a web administration interface .
However Hibernate Search module also provides index based search capabilities.Below are pros and cons for Solr and Hibernate we should keep in mind while taking our decsion judiously.
Solr:
Apache Solr will be useful when
- We have to do a full text search
- We need to find some text from a paragraph to a page
- It may not be useful when there are lot of filter conditions
- Decoupled from Application itself.It is a dedicated server.So the load at the server will get reduced.
- it supports Faceted Search results and Geo Spatial search results.
Hibernate Search:
- Easy to configure
- In case of hibernate search, updating of index occurs when data base transaction is commited. Hibenate takes care of updation to the index and not requiring us to explicitly run that … making the index near real time.
- Limited features
Earlier Twitter was using MySQL backened for giving the search result.When they moved to real-time version of Lucene, there was a considerable gain in the performance.
Twitter application rely on Solr/lucene for the Real-time indexes, Top tweet indexes,Geo indexes.
Will discuss more in detail in the next blog on Solr with sample example/code.
This is a misleading post. "Hibernate Search" is a module that integrates Hibernate with Lucene. which gives you all the same text searching capabilities as Solr because they both are based on the same Lucene engine. The main difference is the backend implementation (Solr is a standalone server, Hibernate Search is meant to be included in your own app). The opening sentence sounds like you think Hibernate Search is the "LIKE" clause in SQL.
ReplyDeleteYes, Twitter moved to Lucene in 2010, but they never mentioned Solr in their blog post https://blog.twitter.com/2010/twitters-new-search-architecture. You seem to confuse Solr with Lucene. They are not the same thing.