Is it possible to enable a non case-sensitive search
for example
'honda' returns results
'Honda' returns 0 results
there must be some way to ignore case in the searchterm ;-)
DT
Is it possible to enable a non case-sensitive search
for example
'honda' returns results
'Honda' returns 0 results
there must be some way to ignore case in the searchterm ;-)
DT
Comments
Comment #1
davidwhthomas commentedOk, I actually got this working, and partial word search too by changing 1 line in views_fastsearch.module
around line 124
From:
To:
Note, this is PostgreSQL specific, for MySQL you'd need something like
I assume the reason it's not like this by default is performance issues for huge DBs?
In any case it works very efficiently and effectively for me.
regards,
DT
Comment #2
douggreen commentedI don't think that the indexes are case-insensitive. So I don't think that changing this in VFS will help. I think you'll need to look at Drupal core search module.
Comment #3
davidwhthomas commentedperhaps the case-sensitivity is just for taxonomy terms.
I'm particularly interested in filtering on free tagging vocab terms and needed to implement a case-insensitive wildcard search of free-tagging vocab terms.
In any case, there was definitely a case-sensitivity issue when the keyword is a taxonomy term.
The fix I posted above works in all cases so far.
DT
Comment #4
civicpixel commentedThis modification seems to be working well for one of our sites as well, thanks David.
Comment #5
davidwhthomas commentedThanks, glad to hear it.
It's working well for me too.
Thanks to the developer(s) for a very useful module.
DT
Comment #6
s.daniel commentedIn version 5.x-2.x-dev (2007-Aug-11) I find this code at line 137:
$and_clause[] = "$tablename.data like '%%%s%%'";Does the talk here apply to dev version as well?
Comment #7
krunar commentedhello
i have test the patch to 5.x-2.x-dev and 5.x-2.0 but i can not make it work to search part of the word
if anyone can help i would really apprieciate since my customer is getting a little crazy:)
thank you
Comment #8
radhika.w commentedthanks thanks a ton!!
this helped me solve a huge problem..
I am using DRUPAL 6.8 and had the problem for searching case sensitive data ...
I wanted the results for the keywords 'HONDA' and 'honda' and 'HonDa' to be the same ...
But for some reasons Drupal doesnt allow the same ... yes its Drupal specifically, cause when i run the same query in mysql, i get the results for different cases to be same ..
So all i did was i changed the query to something like this:
SELECT * FROM $tablename WHERE title LIKE '%%$keyword%%'|| category LIKE '%%$keyword%%' || theidea LIKE '%%$keyword%%'
Yippee! ! ! ...
It works for me .. !!
Thanks a ton again ..
Enjoy,
Radhika
Comment #9
kamleshpatidar commentedHi Radhika,
where i will have to add this? In Drupal cire search module or in VFS. I have three exposed fields
1. Search: Fast Index 2 & 3 are CCK fields.
I want all search fields should be non case sensitive & they can search partial word like, kamlesh or kam or lesh.
Best,
Kamlesh
Comment #10
radhika.w commentedhi kamlesh,
m sorry wont be very helpful if this is entirely realted to CCK, cause I m not into it at all. However, I believe at the same time, that there shouldnt be much difference anyway :)
Well, the code that I had pasted on the forum is used in a custom module that I had built for profile searching...
I have a module that helps me store the data of 1800 people. The search string that I have pasted, searches the field as per qour requirements :)
Like the search strings 'kam' or 'esh' or 'l' or 'Kam' or 'KAm' or 'LESH' and so on.. would all return results containing 'kamlesh' :)
HTH, :)
Radhika
Comment #11
kamleshpatidar commentedHi Radhika,
Thank you for reply. I am using only Core search technique, & that's not work on partial word search. Now i am using Views Fast Search module (search based on Drupal core Search).
Has anybody ever used OR condition in Views Filter? if Yes then please guide me.
Best,
Kamlesh