O'Reilly logo

Instant Apache Solr for Indexing Data How-to by Alexandre Rafalovitch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pulling data from the database with DIH (Intermediate)

Solr is not a database, even though some of the features introduced in Version 4 make it closer to one. Therefore, many production configurations involve having the master content stored in a database, and then copied into Solr and re-organized for faster searching.

DataImportHandler has strong support for importing data from the databases, both as a complete set and in incremental-delta mode.

Let's see how DIH makes importing data from a database easy.

Getting ready

We need to create a database first. We are going to use DerbyDB, which comes bundled with Java (and is called JavaDB), as the database is filesystem-based and also includes a built-in client. If your system does not have Derby installed, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required