symfony-cmf / search-bundle

UNMAINTAINED - search Bundle for the Symfony CMF project integrating with LiipSearchBundle
http://cmf.symfony.com/
8 stars 10 forks source link

Ignore lower and upper letters in search query #13

Closed ilijastojkovic closed 11 years ago

ilijastojkovic commented 11 years ago

Do you know, how I can ignore lower and upper letters in search query? i.e. If I type search query "Git" or "git", I want to get the same search results.

lsmith77 commented 11 years ago

which PHPCR implementation did you use?

levuro commented 11 years ago

we use jackrabbit

lsmith77 commented 11 years ago

ok .. this is surprising. afaik CONTAINS(), which we are using, is case insensitive. will investigate.

dbu commented 11 years ago

i thought the queries are case insensitive. (i would expect issues with jackalope-doctrine-dbal with postgres and maybe sqlite)

but indeed http://www.day.com/specs/jcr/2.0/6_Query.html#6.7.19%20FullTextSearch does not say anything.

there is the LOWER function in sql2. maybe we should strtolower the search string and LOWER() the field we search on? but i am afraid what the performance impact would be. if we are unlucky, jackrabbit would stop using lucene then and compare in-memory...

lsmith77 commented 11 years ago

hmm it seems to work as expected: http://cmf.liip.ch/search?query=CMF vs. http://cmf.liip.ch/search?query=cmf which also uses Jackrabbit.

lsmith77 commented 11 years ago

and this is the search query that is generated:

SELECT [jcr:uuid], [phpcr:class], title, body FROM [nt:unstructured] WHERE ((ISDESCENDANTNODE([/cms/content]) AND (CONTAINS(title, 'cmf') OR CONTAINS(body, 'cmf'))) AND NAME([nt:unstructured]) = 'phpcr_locale:en')
lsmith77 commented 11 years ago

so it should work case insensitive with Jackrabbit. for Doctrine DBAL it seems to also work on SQlite at least.

levuro commented 11 years ago

please close this issues - this is working - what is not working is the search in the sonata admin bundle - which is case sensitive