Forums / Extensions / eZ Find / Partial or Ignore case searching ?

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