7

I would like to be able to search a CouchDB database using Solr. Are there any projects that provide such an integration?

I am also aware of CouchDB-Lucene. Is there a way to hook Solr into that?

Thanks!

David V
  • 11,531
  • 5
  • 42
  • 66

3 Answers3

7

It would make more sense to roll your own, given how wasy it easy. First you need to decide what kind of SOLR schema to use and how to map your CouchDB documents onto that schema. Then simple iterate through all the documents in a db Pagination in CouchDB? and generate SOLR <add> documents.

People do this all the time with all kinds of data sources. Since SOLR is essentially searching a single table, the hard work is often figuring out how to map your database format onto a single table. Read up on what you can do with the SOLR schema, and you may be surprised at how easy this is.

Community
  • 1
  • 1
Michael Dillon
  • 31,973
  • 6
  • 70
  • 106
  • Would this require a daemon or service to continually do this? I recognize that couchdb-lucene also requires continual execution. – David V Jun 23 '11 at 14:56
  • That is ususally how people update search engines. A daemon polls the data source every minute to collect changed data, or the data source pushes change transactions to a daemon. The daemon then submits add transactions to SOLR's update URL. – Michael Dillon Jun 24 '11 at 02:17
4

There is a CouchDB integration for ElasticSearch available, apart from feeding ElasticSearch with JSON on your own. Both work with schema-less JSON, so it's very easy to integrate them.

In terms of features, ElasticSearch would offer a comparable set to Solr (in addition to some unique features, of course.)

karmi
  • 14,059
  • 3
  • 33
  • 41
2

According to this

http://wiki.apache.org/couchdb/Related_Projects

there was a CouchDB-Solr2 project (scroll down to the end), which is no longer maintained.

davek
  • 22,499
  • 9
  • 75
  • 95
  • +1. At this time, my feeling is, CouchDB-Lucene is very good. Otherwise, there are not many 3rd-party search tools. – JasonSmith Jun 17 '11 at 23:55