Live Search performs search without minimal word length when space is included.

superkc9 - May 16, 2008 - 00:54
Project:Live Search
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Typing a space after a word smaller than the minimal length causes a search query to be performed. For example, typing 'in ' a short pause to think will return 'Your search yielded no results' and then cause the warning/error 'You must include at least one positive keyword with 3 characters or more.' to be displayed on the next page the user navigates to.

While most users will probably not encounter this problem too often, it has come up several times. I found that adding a call to jQuery.trim() on line 31 of livesearch.js solves the problem, and doesn't seem to cause too big of lag.

line 31var keyword = Drupal.encodeURIComponent(jQuery.trim(searchBox.val()));

 
 

Drupal is a registered trademark of Dries Buytaert.