Create custom solarium client with DIC
wiistriker opened this issue · 5 comments
Hi!
This bundle provide automatic client creation, but we can't configure other parameters of the Solarium client. For example, we can't register new plugin.
Instead using "syntax-sugar" provided with this class we can create class as regular service:
services:
solarium.client.default:
class: Solarium_Client
And we can do everything with this object.
Another benefit of this bundle: DataCollector. We may tag this custom services with some tag and add logger plugin. What do you think about such implementation?
ping @Seldaek
I think it'd be great to have automatic indexing and such like the ElasticSearch bundle provides, but it's quite a bit of work and I really don't have time for it unfortunately. If you feel like doing some work towards this, sounds good to me. I'll try to review in a timely manner at least :)
@Seldaek question not bout automatic indexing =)
question about how this bundle really work. bundle just provide factory for solarium client creation, but we already have DIC which can create clients in more flexible way. maybe we should go in this way?
I just want to add custom plugin for one of my solr clients in project. Instead just call registerPlugin in DIC, i need to create custom client class
Well, the bundle creates DIC services, but I agree it should be possible to override the way the bundle creates it, so that you could for example create a service yourself, and tell the bundle that for client X, the existing service A should be used. That way data collecting etc should be ok.
Does not seem to be a common use-case. Its always possible to create a compiler pass to change/replace the services if really needed. So closing this one now after more than 10 years.