On Aug 24, 2007, at 5:29 PM, Wu, Daniel wrote:
Theoretically and practically, embedded solution will be faster than
going through http/xml.  I would like to see solr has some sort of
document source adapter architecture which will iterate through all the documents available in the document source. This way, if the documents come from database for example, it can be simply a sql query in the solr
configuration file.

In Ruby land we already have this sort of mechanism:

  source = YourCustomDataSource.new
  mapping = {
    :title = :custom_data_source_title,
    :author = :custom_data_source_author
    # ...
  }
  indexer = Solr::Indexer.new(source, mapping)
  indexer.index

The only requirements are that YourCustomDataSource returns documents successively via the #each method, and that each of those documents have an attribute accessor #[] method. This already works with CSV files, another Solr server, or an array of objects with the current solr-ruby library.

It is my dream to see JRuby blend into Solr to facilitate this sort of thing "in process".

        Erik

Reply via email to