3

I am planing to add search feature in my web application. I am using Struts 2 framwork for the application and the items that will be searched are strored in a Relational database. In order to achieve a full text search engine I have following doubts :

  1. For database based search engine should I use just lucene or some other utility based on Luncene like Solr, luSql, Compass etc.
  2. In case of Solr, can it be embeded in to the web applcation rather than deploying it as a seaparate WAR.
  3. Is solr used to search relational databases or just file systems
2
  • You really should tell us what technologies you're using for you web app. Commented Jun 3, 2010 at 7:19
  • I am using Struts 2 framework Commented Jun 3, 2010 at 7:21

3 Answers 3

2
  1. Depends on the level at which you want to operate. Since you are already inside a Java app, it's pretty easy to use the Lucene API, index your data and then use it again to search. Anything that you can do with Solr you could do with Lucene but probably with much more logic and glue code.

  2. Yes, have a look at http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer

Sign up to request clarification or add additional context in comments.

2 Comments

But is solr used to search relational databases or just file systems ?
2

look at hibernate search. i am pretty sure it fits ur needs as the data that is stored in DB is what will be indexed and hence made available for search. as far as I remember Solr stores the index on filesystem (though there might be a plugin to store the index in DB).

u am also look at www.elasticsearch.com. it is from the creator of compass. i think there will be limited support provided for compass.

1 Comment

Hibernate search will only work smoothly if he is already using hibernate for persistence, right?
0

You are saying that your data is in database, but you are not mentioning whether you are using a ORM solution. If you do I also suggest you have a look at Hibernate Search. Hibernate is a requirement, but you can work against the classic Session or use JPA. The biggest advantage in an webapp is probably that you always work with managed entities and don't have to write boiler plate code to convert from and to Lucene Documents. Solr has its place as well though. It really depends on your requirements and architecture.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.