Correct me if I'm wrong, but searching with Views Fastsearch appears to be case sensitive. Shouldn't this be (at least) optional?

CommentFileSizeAuthor
#4 views_267021.patch453 byteschristefano

Comments

christefano’s picture

Priority: Normal » Critical

It's taken me two days to figure out that this was the reason my searches weren't working.

christefano’s picture

Title: case sensitive » searches are case sensitive
Category: feature » bug

This is a significant difference from the core search in Drupal, so I'm looking at this as a bug.

Anonymous’s picture

this looks like views wasn’t handling the case where a query that had been processed but still contained strings that db_query uses for arg substitution where passed to db_query. this led to unintended substitutions.

for example, views would pass this sql:

SELECT node.nid FROM node node  WHERE (UPPER(node.title) LIKE UPPER('%s is not the substitution you were looking for%')) AND (node.type IN ('droids')) AND (node.status = '1')   LIMIT 0, 12

to db_query, and the '%s' would get replaced with the first element of $args, which if that happened to be node.title, mysql would see:

SELECT node.nid FROM node node  WHERE (UPPER(node.title) LIKE UPPER('node.title is not the substitution you were looking for%')) AND (node.type IN ('droids')) AND (node.status = ‘1’)   LIMIT 0, 12

looks like case sensitive, but isn’t.

a possible fix just converts '%(s|d|f|b)' --> '%%(s|d|b|f)' before the query is passed to db_query by views like this in views_build_view:

$query = preg_replace('/(%(s|d|b|f))/', '%%$2', $query);
christefano’s picture

Project: Views Fast Search » Views (for Drupal 7)
Version: 5.x-2.0 » 5.x-1.x-dev
StatusFileSize
new453 bytes

Here is Justin's fix in patch form. It applies against 5.x-1.x-dev and 5.x-1.6.

christefano’s picture

Status: Active » Needs review

Needs review.

merlinofchaos’s picture

Status: Needs review » Fixed

This bug was fixed in -dev ages ago.

christefano’s picture

That this was fixed "ages ago" makes me want a new release in a big way. Meanwhile, thanks for the info, merlinofchaos.

merlinofchaos’s picture

sun posted an issue with a list of what he wants to do for a 1.7 release. If you'd like to help, see http://drupal.org/node/208855

The list is shockingly long =)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.