collective / collective.solr

Solr search engine integration for Plone
https://pypi.org/project/collective.solr/
21 stars 46 forks source link

GS profile which does not set connection settings #30

Open saily opened 10 years ago

saily commented 10 years ago

Hi, We're using integration and deployment servers with different solr servers. When transporting a project to our integration system let's say: 'A', we have to use Solr 'A', when transporting to deployment server 'B' we should use Solr 'B'.

Unfortunately collective.solr always sets the connection properties. When setting the connection properties in a custom profile i have to maintain 2 different solr profiles for integration/deployment.

I'd like to see a more comfortable solution here, any ideas?

tisto commented 10 years ago

You can set the connection properties in your buildout file: https://github.com/collective/collective.solr#solr-connection-configuration-in-zcml

Unfortunately this does not seem to work all the time. I haven't had time to look into that though. In my opinion we should get rid of the option to configure the Solr connection TTW altogether.

saily commented 10 years ago

Ii already tried that one, but did not work for me.

In my opinion we should get rid of the option to configure the Solr connection TTW altogether.

+100, absolutly. Configuration through buildout would be my prefered approach.

tisto commented 10 years ago

It seems collective.solr tries to connect with the zcml connection params first and if that doesn't work fall back to the control panel params:

https://github.com/collective/collective.solr/commit/ac1cd964c8e28a8429dc3a271efaac46dcc6bdc9#diff-4d1b2afc411d0fb859fd80503024d05fR105

Try to pdb into that code block to see what goes wrong. I would be open to amend the code to always use the zcml params when they have been specified (and then maybe entirely remove the control panel params later on).

cc @csenger