collective / collective.solr

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

Control panel broken after upgrading from 5.0.3 to 6.0a1 #155

Open mauritsvanrees opened 8 years ago

mauritsvanrees commented 8 years ago

I was testing with collective.solr 5.0.3 and then tried 6.0a1. Same with master. Two problems:

  1. You get KeyError: collective.solr.facets in the search viewlet.
  2. On the control panel you get another KeyError: 'Interface collective.solr.interfaces.ISolrSchema defines a field index_timeout, for which there is no record.'

I assumed there were one or more new options in the registry, so I started creating an upgrade step for this, trying to avoid overwriting the existing settings. But I see that until version 5.0.3 the data was not in the registry, but in a config utility. This is now broken, so we cannot get the data back. When I do a queryUtility(ISolrConnectionConfig) the result is:

<persistent broken collective.solr.manager.SolrConnectionConfig instance 
'\x00\x00\x00\x00\x00\x00\x14!'>

I will make a pull request that registers our interface in the configuration registry and that removes the broken utility.

It would be nicer if the utility code could be restored so we could take over the settings in this upgrade. Currently users will need to redo any configuration changes they made.

tomgross commented 7 years ago

@mauritsvanrees Is this fixed with your PR or is anything missing?

mauritsvanrees commented 7 years ago

The control panel works after applying the upgrade. But any previous settings have been lost because the SolrConnectionConfig instance is broken: its class is gone.

Options:

  1. Bring back the SolrConnectionConfig in manager.py so we can read the config in the upgrade step and port it to the new settings.
  2. Keep it as it is, and tell people that they need to go through all settings again. This is what the changelog entry in my PR tells them.

I have no site where I am using a previous collective.solr version, so I don't mind. But others might.

tisto commented 7 years ago

@mauritsvanrees I'm ok with both options. If somebody is willing to implement 1) that would be a lot better of course.