Closed (works as designed)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2007 at 17:06 UTC
Updated:
6 Aug 2008 at 17:33 UTC
Hi, I'm marking this as a bug report but I'm not sure if the behaviour I found is by design: I was playing with an experimental view exposing a Search: Index filter and I couldn't get an empty result set even if I entered text absolutely not existing in my test nodes (for example _unfindable_): any unfindable text led to a list of the whole set of test nodes.
I gave a look to modules/views_search.inc and found that inserting the following line in the code fixed the problem
--- views/modules/views_search.inc Sat Mar 03 23:59:33 2007
+++ views/modules/views_search.inc Wed Sep 12 19:03:26 2007
@@ -39,7 +39,8 @@
// Calculate maximum relevance, to normalize it
$normalize = db_result(db_query('SELECT MAX(relevance) FROM temp_search_sids'));
- if (!$normalize) {
+ if (!$normalize) {
+ $query->add_where("0");
return;
}
$select2 = str_replace('i.relevance', '('. (1.0 / $normalize) .' * i.relevance)', $select2);
Could you give me a feedback?
| Comment | File | Size | Author |
|---|---|---|---|
| view_export.php_.txt | 2.57 KB | plach |
Comments
Comment #1
plachcdo
Comment #2
Zoologico commentedI got around this using:
http://drupal.org/project/views_fastsearch
Instead of the default Search Index.