Partial or Ignore case searching ?

Author Message

H-Works Agency

Friday 15 October 2010 6:07:29 am

Hello,

How can we use ezfind query to make partial searching and to ignore case during search ?

For now i use empty query + filter conditions but i can't search partial terms.

"

$params['Filter'] = array(array($class_identifier.'/'.$attribute_identifier.':"'.$attribute_value.'"'));

$search = $solrSearch->search( '', $params );

"

Any help appreciated !

EZP is Great

Paul Borgermans

Sunday 17 October 2010 2:52:27 pm

The problem is that lowercasing (which is on by default for indexed terms) is not done for query terms when wildcards or other query modifier characters are inserted

Its actually a backend issue

hth

Paul

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

H-Works Agency

Monday 18 October 2010 4:16:42 am

Hello,

Could you someone put an example ?

This doesn't work :

$search = $solrSearch->search( 'eZ*', $params=false );

Neither does this :

$search = $solrSearch->search( 'eZ*', $param['Filter']=array('class/attribute:val*') );

Strange that fuzzy search or wildcard doesn't seem to exist on solr.

EZP is Great

Paul Borgermans

Thursday 21 October 2010 10:51:13 am

"

Hello,

Could you someone put an example ?

This doesn't work :

$search = $solrSearch->search( 'eZ*', $params=false );

Neither does this :

$search = $solrSearch->search( 'eZ*', $param['Filter']=array('class/attribute:val*') );

Strange that fuzzy search or wildcard doesn't seem to exist on solr.

"

(note: your PHP code is not really what should be done)

You can use wildcards, but for all common setups, the string supplied must be lower case as I mentioned in my previous reply to you.

Another thing to look for: can you check also for your setup what is the default search handler in ezfind.ini? If it is set to heuristic, it will work, if not it wont and you must specify it as 'heuristic', 'standard' or 'simplestandard' :

$search = $solrSearch->search( 'ez*', array('Filter' => array('class/attribute:val*'), 'QueryHandler' => 'heuristic' ));

also class/attribute must probably of type 'text'

hth

Paul

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

Jani Tarvainen

Thursday 25 November 2010 11:05:55 am

Paul,

I take it this is related: I was doing some filtering today and encountered an issue with filters being case sensitive.

I started development by hard coding a test fetch filtered using

 store/city:Middle*

I got results and moved forward with implementation. Eventually I realized there were issues with case sensitivity as my test search "middle*" returned no results. I also confirmed this by doing a raw Solr query though the admin interface.

A colleague kindly pointed me here: http://dy.fi/86q

It states that we would need an "analyzer" to yield results. Knowing close to nothing about Solr internals I'd like to know can (and will) this be implemented in future versions of eZ Find?

--
http://ezpublish.fi/

Paul Borgermans

Thursday 25 November 2010 2:24:43 pm

"

Paul,

I take it this is related: I was doing some filtering today and encountered an issue with filters being case sensitive.

I started development by hard coding a test fetch filtered using

 store/city:Middle*

I got results and moved forward with implementation. Eventually I realized there were issues with case sensitivity as my test search "middle*" returned no results. I also confirmed this by doing a raw Solr query though the admin interface.

A colleague kindly pointed me here: http://dy.fi/86q

It states that we would need an "analyzer" to yield results. Knowing close to nothing about Solr internals I'd like to know can (and will) this be implemented in future versions of eZ Find?

"

It is matter of configuration with eZ Find (2.3) coupled to some understanding of Solr internals indeed. The good news: its most probably solvable without hacking, the bad news: you'll need to learn a bit more. Whenever case sensitivity is an issue, you will need to make it insensitive. Part is backend configuration, the other part (template) functions that lowercase when needed (or not).

I see a few ways for future eZ Find releases to ease this aspect further, in the meantime you can contact me directly

Paul

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

H-Works Agency

Friday 26 November 2010 7:42:41 am

Hello Paul and thank you for your previous response.

I'll take some time to read and understand the case sensitivity issue but aside from this why do you say using "$solrSearch->search( 'eZ*', $params=false );" is not the right way to handle solr/ezfind searching from a php module ?

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:03:08
Script start
Timing: Jan 18 2025 02:03:08
Module start 'layout'
Timing: Jan 18 2025 02:03:08
Module start 'content'
Timing: Jan 18 2025 02:03:09
Module end 'content'
Timing: Jan 18 2025 02:03:09
Script end

Main resources:

Total runtime0.5686 sec
Peak memory usage4,096.0000 KB
Database Queries73

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.0625152.6406
Module start 'layout' 0.00850.0053 740.703139.4844
Module start 'content' 0.01380.5532 780.1875647.7734
Module end 'content' 0.56700.0015 1,427.960920.1328
Script end 0.5685  1,448.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.7478160.0003
Check MTime0.00160.2738160.0001
Mysql Total
Database connection0.00170.293410.0017
Mysqli_queries0.478184.0815730.0065
Looping result0.00080.1461710.0000
Template Total0.530093.220.2650
Template load0.00180.321020.0009
Template processing0.528292.897320.2641
Template load and register function0.00010.024110.0001
states
state_id_array0.00100.168310.0010
state_identifier_array0.00150.255320.0007
Override
Cache load0.00180.3080690.0000
Sytem overhead
Fetch class attribute can translate value0.00090.155830.0003
Fetch class attribute name0.00150.2554100.0001
XML
Image XML parsing0.00190.331930.0006
class_abstraction
Instantiating content class attribute0.00000.0064140.0000
General
dbfile0.00180.3155300.0001
String conversion0.00000.001840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs