basdenooijer/solarium — Issue #74: Client instance shouldn't be tied to a specific core and server
Author: basdenooijer
Created: 2012-02-12 17:36:39+00:00
State: open

Currently your client instance holds the core and server settings. To execute queries on multiple cores and/or servers you have two options: multiple client instances or constantly altering the settings.
Multiple instances are not ideal because this requires you to duplicate setup work like adding plugins. Altering setting isn't a very elegant solution either.
The query object also doesn't seem to be the right place to hold these settings. If you want to execute the same query on two cores/servers that still would require your to keep adjusting settings.

The best option might be to have a single client instance, multiple query instances and multiple server/endpoint definitions. At query execution you can supply a query and an endpoint. For ease of use in case of only a single endpoint that will be used by default and with multiple endpoints you can define a default.

The concept of an 'endpoint' (not sure about the name yet) would also be a nice way to implement things like loadbalancing and/or failover. The current implementation as a plugin had to override some client logic to achieve the same.