I replaced the default search terms page with a views-based alternative, but the client noticed that the search is lousy. I just confirmed that the default search is returning extremely relevant results that the views-based search is missing entirely. I have a node called "WRAP extends enviro wine program to U.S." A search for wrap finds the node, but "wrap extends" does not, while the default search works perfectly. This can only mean that something in the way that views is doing the filter is not working correctly.

Comments

merlinofchaos’s picture

Status: Active » Fixed

The current -dev has a vastly improved search filter and can sort by relevancy where the previous one couldn't. Or it could pretend it could but it was a giant lie.

fumbling’s picture

Thanks merlin!

Charlie - I would be very interested in trying your solution in conjunction with the latest dev version. I sent you another note today after reading your other thread on the issue, really look forward to seeing how this is done. Thanks.

Peter Swietoslawski’s picture

Version: 6.x-2.2 » 6.x-2.x-dev
Status: Fixed » Active

I couldn't make this work. Actually exposed Search filter on latest dev version (2009-Feb-26) of Views produces malformed SQL (missing table names):

SELECT node.nid AS nid, SUM(search_index.score * .count) AS score 
FROM node node  
LEFT JOIN search_index search_index ON node.nid = search_index.sid 
LEFT JOIN search_total ON search_index.word = .word 
WHERE (search_index.word = 'your') AND (search_index.type = 'search_index') 
GROUP BY search_index.sid, nid 
HAVING COUNT(*) >= 1

when run from this simple View (clean install of Drupal 6.10):

$view = new view;
$view->name = 'custom_search';
$view->description = '';
$view->tag = 'custom';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('filters', array(
  'keys' => array(
    'operator' => 'optional',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 0,
      'operator' => 'keys_op',
      'identifier' => 'keys',
      'label' => 'Search: Search Terms',
      'optional' => 1,
      'remember' => 0,
    ),
    'id' => 'keys',
    'table' => 'search_index',
    'field' => 'keys',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'teaser' => 1,
  'links' => 0,
  'comments' => 0,
));
merlinofchaos’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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