Forums / Extensions / eZ Find / eZ Find filter an indexed field with whitespace doesn't work

eZ Find filter an indexed field with whitespace doesn't work

Author Message

Matthieu Sévère

Monday 17 May 2010 7:47:55 am

Hello,

I have a user indexed on solr (visible in solr admin)

I want to filter on an attribute "site" (object relation)

I can see that the sub-attribute is indexed well :

<arr name="subattr_site-name_s">
 <str>Malaisie SELANGOR</str>
</arr>

But when I do a filter like that with ezfind or directly in solr admin:

&fq=subattr_site-name_s:France+LIBOURNE

I got the user above returned even if it doesn't match the result.

I have tested with other cases and it always the same when there is a whitespace in the filter.

Anyone got the same problem ?

Thank you for the help !

--
eZ certified developer: http://ez.no/certification/verify/346216

Paul Borgermans

Monday 17 May 2010 1:04:27 pm

I guess this attribute is indexed as a string type in combination with eZ Find 2.1?

You need to put quotes around the value then:

 &fq=subattr_site-name_s:"France LIBOURNE"

If its indexed as text it should become:

&fq=subattr_site-name_s:(+France +LIBOURNE)

hth

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Matthieu Sévère

Monday 17 May 2010 2:06:23 pm

Okay I just tested the query directly in solr and it's working. But this is initially a filter triggered by a facet so it is a classic use case of eZ Find as I declared the attribute as string in eZ Find.

Is this an issue ? Do I need to post this to issues.ez.no ?

If I understood ok the class ezfeZPSolrQueryBuilder should take into consideration if DatatypeMapFilter to check if it is a string and add quotes around filter value ?

--
eZ certified developer: http://ez.no/certification/verify/346216

Matthieu Sévère

Monday 17 May 2010 2:19:59 pm

It works very fine if I add quotes around $value of ezfeZPSolrQueryBuilder::getParamFilterQuery()

Thank you Paul !

--
eZ certified developer: http://ez.no/certification/verify/346216

Matthieu Sévère

Tuesday 18 May 2010 12:42:32 am

This is in fact related to this issue : http://issues.ez.no/16419

--
eZ certified developer: http://ez.no/certification/verify/346216

Nicolas Pastorino

Tuesday 18 May 2010 8:47:37 am

Solved topic ? you may want to mark it as such :)

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Matthieu Sévère

Tuesday 18 May 2010 9:25:07 am

Done :)

--
eZ certified developer: http://ez.no/certification/verify/346216

Nicolas Pastorino

Tuesday 18 May 2010 9:30:09 am

"

Done :)

"

Cool :)

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye