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

eZ debug

Timing: Jan 18 2025 02:02:31
Script start
Timing: Jan 18 2025 02:02:31
Module start 'content'
Timing: Jan 18 2025 02:02:31
Module end 'content'
Timing: Jan 18 2025 02:02:31
Script end

Main resources:

Total runtime0.2744 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 591.1953180.7422
Module start 'content' 0.00850.0076 771.9375107.2891
Module end 'content' 0.01610.2582 879.2266536.7500
Script end 0.2743  1,415.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00361.3249200.0002
Check MTime0.00130.4879200.0001
Mysql Total
Database connection0.00090.319610.0009
Mysqli_queries0.217779.34091410.0015
Looping result0.00140.51601390.0000
Template Total0.257894.010.2578
Template load0.00090.328710.0009
Template processing0.256993.639110.2569
Override
Cache load0.00060.234010.0006
Sytem overhead
Fetch class attribute can translate value0.00100.355010.0010
XML
Image XML parsing0.00020.087810.0002
General
dbfile0.00511.8760200.0003
String conversion0.00000.011630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs