Shay_t
Shay_t

Reputation: 163

Solr DataImportHandler, Multiple documents

I am very new to Solr...

I need to Import data from a DB with different contexts (schemas). and I want to be able to search for both of those documents using a single query.

I did some reading, and I am a bit confused...

since I understand the DataImportHandler will read only the first document tag. I don't know how to define another document.

what will be the best approach to achieve that.

can you help please to clean up the mist.

thank you.

Upvotes: 0

Views: 490

Answers (1)

Persimmonium
Persimmonium

Reputation: 15789

you can have two succesive <document> tags and solr will execute both.

If you can get by this way (not sure what db are you using, so not sure if you can specify the schema part in the SELECT of each document tag).

If the above is not possible you can always use two different db-data-config.xml (and two different endpoints of course), each one targeting one db/schema. But be warned:

  • you cannot use &clean=true in both as your existing docs will be wiped, you need to do it explicitly on the beggining only.
  • delta indexing gets more complex too.

Upvotes: 1

Related Questions