Saturday, August 9, 2008

Navigating Search with Compass

I have been on two projects where Google-style searching was a requested feature. For each, I used Compass, which bridges the gap between Hibernate and Lucene. One of those projects was recently deployed and is handling thousands of queries a day on an index that includes a few million documents. Prior to this deployment, searching was performed through SQL/Hibernate queries which, we were finding, did not necessarily scale very well.

I am pleased as pie with Compass. The documentation is a little daunting -- mirroring Hibernate is but one of Compass's many features which the online reference covers. In the end, though, integrating with Compass amounts to little more than annotating the classes you intend to index and using Compass's query API to generate search results.

I had run into out-of-memory problems when building the initial index with Compass. After many hours of tweaking configuration settings, I finally was able to fix this by appending "useCursorFetch=true" to the MySql JDBC Url, a problem described by this forum post.

I highly recommend Compass if your project needs search functionality. My hat goes off to Compass developers. Many thanks for providing a fantastic open-source framework.

1 comment:

Sirisha said...

The information provided is quite good.
Is there any sample application with spring and hibernate and compass.
or configuration settings for the integration of compass with the existed spring and hibernate project.ncho