While Lucene can certainly do the job, the Solr server - a subproject of the Lucene family which uses Lucene at its core - gives you a more readymade executable system.
Lucene is just a toolkit for efficient full text search, while Solr adds all the bells and whistles that all client applications typically require. It means you'll have to write much less code with Solr than you would with Lucene.
For your requirements,
- Solr gives you a DB import functionality out of the box. You only need to change an XML configuration file, and Solr will do all the DB querying and pulling in data for you.
The raw Lucene approach would involve you having to code all the DB querying in
java code.
- With Solr, tokenization behaviours and document schema for your log records can be specified in XML configuration files and changed easily.
With Lucene, you either have to hardcode the schema and tokenization behaviour in java code, or rollout your own configuration strategy to keep it flexible.
Because the data here are application logs which may have unusual strings like "at com.myapplication.myclass.mymethod(line 327)", keeping tokenization behaviour in an external schema and being able to quickly modify it and try out different behaviours through trial and error is a plus.
- Solr is already a standalone executable system. Just download and run a jar as described
here and your search engine will be up and running. You can send HTTP requests and get back search results in JSON/XML format.
Depending on how simple your use cases are, you may even be able to use solr directly from javascript through ajax (though I've found this rarely works out, because simplistic search implementations don't give the most relevant results - you usually have to deploy some business logic inbetween the browser and solr server, and post process the results to find the most relevant ones).
- Solr gives you drilldown search (that's the term for the categories and filters that sites like ebay provide in their sidebars; also called "faceting"). This is useful if, for example, you want your users to filter only on certain components of your application or certain classes or java packages.
- From a programming point of view, the Solr API is much simpler than Lucene API. With Lucene, you have to manage not only the search but also the search index infrastructure. Solr handles the search index automatically, and exposes just the primary search API to your application.