user2102627
user2102627

Reputation: 63

Can I use one entity for mulitple datasources in Solr?

I want to import mutiple sharding databases into one entity in Solr. The sharding databases have the same scheme.

Is it possible?

Thanks.

Upvotes: 0

Views: 157

Answers (1)

Alexandre Rafalovitch
Alexandre Rafalovitch

Reputation: 9789

Sure, it should possible. Are you using DataImportHandler (the question does not say)?

Have you already done a DIH import of a single database and want to just have that definition apply to multiple sources?

If so, you have two basic options to go forward:

  • Copy the entity definition with appropriately changed sources. When you run DIH, it will execute first entity, then the other
  • Create an outer entity with rootEntity = false and with your database entity inside of it. Then, your outer entity needs to generate some sort of variable with each round corresponding to different shard. Your inner entity will use that variable to connect to the correct shard and execute the load. You could , for example, have an XML file with your dataSource names for the outer entity to parse it with XPathEntityProcessor

Upvotes: 1

Related Questions