#4 — collective.solr throws exception when used by Uberselection Widget

StateResolved
Version: 1.0
AreaFunctionality
Issue typeBug
SeverityMedium
Submitted byAnton Stonor
Submitted onDec 08, 2008
Responsible Andreas Zeidler
Target release: 1.0
Return to tracker
Last modified on May 12, 2009 by Andreas Zeidler
A quick report. I haven't dived deeper into this one, but it looks like Uberselection Widget triggers an exception in Solr.

My guess is that collective.solr might expect a string as parameter in searchResults and maybe Uberselection Widget passes "SearchableText" as an unicode object.

If my guess is wrong, I'll dig into this.

From the bottom of the traceback:
 
    * Module zope.tales.expressions, line 217, in __call__
    * Module Products.PageTemplates.Expressions, line 161, in _eval
    * Module Products.PageTemplates.Expressions, line 123, in render
    * Module plone.app.form.widgets.uberselectionwidget, line 73, in __call__
    * Module plone.app.vocabularies.catalog, line 356, in results
    * Module plone.app.vocabularies.catalog, line 165, in search
    * Module collective.indexing.monkey, line 81, in searchResults
    * Module collective.solr.monkey, line 28, in searchResults

    * Module collective.solr.dispatcher, line 39, in __call__
    * Module collective.solr.dispatcher, line 72, in solrSearchResults
    * Module collective.solr.utils, line 46, in prepareData

TypeError: character mapping must return integer, None or unicode
Steps to reproduce:
 * Add a collection portlet
 * Search for anything with the uberselection widget
Added byAndreas ZeidleronDec 09, 2008 03:36 PM
Issue state: unconfirmedopen
Target release: None1.0
Responsible manager: (UNASSIGNED)witsch
i haven't seen that one yet — thanks for reporting! i'll look into it soon together with some other pending issues...
Added by(anonymous)onDec 09, 2008 04:02 PM
Cool.

I had a fresh look and can reproduce on a vanilla install. Can confirm this is an unicode issue. Adding to following to utils.py:46 fixed it on my box:

        if isinstance(searchable, unicode):
            searchable = searchable.encode('utf-8')
Added byAndreas ZeidleronMay 12, 2009 03:11 PM
Issue state: ConfirmedResolved
fixed in http://dev.plone.org/collective/changeset/85923
Added byAndreas ZeidleronMay 12, 2009 03:23 PM
fyi, the fix has been included in http://pypi.python.org/pypi/collective.solr/1.0b9

No responses can be added.