Products.cmfplone: CatalogError: Unknown sort_on index (relevance)

Created on 30 May 2017  路  7Comments  路  Source: plone/Products.CMFPlone

A fresh Plone 4.3.12 installation (specifically via docker) gets the error CatalogError: Unknown sort_on index (relevance) when crawled by bots, as per thread in https://community.plone.org/t/unknown-sort-on-index-relevance/4239

For example, if I browse to a user's page (/author/someuser) and then follow the link to search for all content created by that user, I get to /search?Creator=someuser&sort_on=created&sort_order=reverse. I can then select the "sort by relevance" link to go to /@@search?sort_on=relevance&Creator=someuser, from where I can click on the RSS feed to get /search_rss?sort_on=relevance&Creator=someuser, which gives the CatalogError.

bug

Most helpful comment

It was a few fixes I did last week on 4.3, and I already forward ported it to Plone 5.0/5.1/5.2.
It could happen in several packages. I have a list of PRs. All have been merged, and all have been released, except CMFPlone.
For 4.3:

And the forward ports:

All 7 comments

@rodfersou this seems to be related with #1600.

Seeing this in a Plone 4.3.14 instance (was a 4.3.11 site that was just upgraded and moved between servers).

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module Products.CMFPlone.browser.syndication.views, line 56, in __call__
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module zope.pagetemplate.pagetemplate, line 240, in __call__
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 583, in do_setLocal_tal
  Module zope.tales.tales, line 696, in evaluate
   - URL: /opt/plone/eggs/Products.CMFPlone-4.3.14-py2.7.egg/Products/CMFPlone/browser/syndication/templates/search-rss.pt
   - Line 11, Column 0
   - Expression: <PythonExpr ( [i for i in feed.items])>
   - Names:
      {'args': (),
       'container': <ATFolder at /site>,
       'context': <ATFolder at /site>,
       'default': <object object at 0x7ff7d6759560>,
       'here': <ATFolder at /site>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x7ff772bd5a48>,
       'request': <HTTPRequest, URL=https://example.com/site/search_rss>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x86842d0>,
       'traverse_subpath': [],
       'user': <SpecialUser 'Anonymous User'>,
       'view': <Products.Five.metaclass.SimpleViewClass from /opt/plone/eggs/Products.CMFPlone-4.3.14-py2.7.egg/Products/CMFPlone/browser/syndication/templates/search-rss.pt object at 0x7ff7ac0847d0>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x7ff7a3ba2350>}
  Module zope.tales.pythonexpr, line 59, in __call__
   - __traceback_info__: ( [i for i in feed.items])
  Module <string>, line 1, in <module>
  Module Products.CMFPlone.browser.syndication.adapters, line 150, in items
  Module Products.CMFPlone.browser.syndication.adapters, line 146, in _items
  Module Products.CMFPlone.browser.syndication.adapters, line 186, in _brains
  Module Products.CMFCore.FSPythonScript, line 127, in __call__
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.PythonScripts.PythonScript, line 344, in _exec
  Module script, line 115, in queryCatalog
   - <FSPythonScript at /site/queryCatalog used for /site>
   - Line 115
  Module AccessControl.ZopeGuards, line 369, in guarded_apply
  Module AccessControl.ZopeGuards, line 391, in builtin_guarded_apply
  Module Products.CMFPlone.CatalogTool, line 389, in searchResults
  Module Products.ZCatalog.ZCatalog, line 604, in searchResults
  Module Products.ZCatalog.Catalog, line 916, in searchResults
  Module Products.ZCatalog.Catalog, line 889, in _getSortIndex
CatalogError: Unknown sort_on index (relevance)

It could be that the error for relevance was a new addition caused by #1600. But I have seen the same and similar tracebacks on earlier Plone versions, already 4.3.7 I think, with different sort_on indexes.
Anyway, should be fixed with a new Plone version, which I expect soonish.

Ah good! Do you recall what the fix is that went into 5.1 so I/we could backport it?

It was a few fixes I did last week on 4.3, and I already forward ported it to Plone 5.0/5.1/5.2.
It could happen in several packages. I have a list of PRs. All have been merged, and all have been released, except CMFPlone.
For 4.3:

And the forward ports:

The problem not only occurs with a spider but also in our case inside the advanced search when you click on the link for the second batch.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdw9 picture cdw9  路  6Comments

mauritsvanrees picture mauritsvanrees  路  5Comments

erral picture erral  路  3Comments

davisagli picture davisagli  路  4Comments

pbauer picture pbauer  路  6Comments