Project:Fuzzy Search
Version:6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

like views_fastsearch
Thanks!!!

Comments

#1

I'd be interested too!

#2

ditto

#3

I'm not doing any more work on the 5.x version of fuzzysearch, but I am happy to work with patches or backports from the 6.x version.

But.... if you look at the views fast search project page:

"This module was the proof of concept of a solution using alternative search SQL that made it into 6.x core. The 6.x implementation is different (better) than this one, but both provide similar speed enhancements. The primary difference is that the 6.x implementation offers better query term support."

So what you are asking for is already in the core search (without the fuzzy part).

#4

Status:active» closed (fixed)

#5

Version:5.x-1.2» 6.x-1.x-dev
Priority:normal» minor
Status:closed (fixed)» active

A views filter for the fuzzy search query would be really cool to have. So I'll reopen this issue :)

#6

Yes, it's on my list of things to get to eventually. Of course, patches are always welcome!

#7

I know this feature request is a bit old, but if anybody is wondering how to combine fuzzysearch with the views module, here is the solution.

I had no time to create a clean integration, so I used a dirty hack. First of all, you need the views module and the views php filter module.
Create a view and activeate the php filter. Use the "filter to these IDs" option and the "Node ID list" Handler.

After that you have to modify the fuzzysearch module. My version number is 1.5, so in line 1173 of the fuzzysearch.module file you see the output of the results.

delete, or comment this:

$output .= '<div class="search-results">';
  foreach ($results as $result) {
    $i++;
    $odd = $i%2 ? 'odd' : 'even';
    $output .= '<div class="fuzzysearch-result '. $odd .'">';
    $output .= theme('fuzzysearch_result', $result);
    if (variable_get('fuzzysearch_debug_score', FALSE)) {
      $output .= '<p>'. t('Completeness: ') . number_format($result->completeness) . t(' Score: ') . number_format($result->score) .'</p>';
    }
    $output .= '</div>';
  }
  $output .= '</div></div>';

You can get all node id's with this snippet:

foreach( $results as $result ){
 
$nidz = $result->nid.", ".$nidz;
}

so $nidz looks like " 3, 40, 29 ".

We can now invoke the created view with this snippet:

$my_content_view = views_get_view('Fuzzysearchview');

$my_content_view->display["default"]->display_options["filters"]["nid_php"]["value"] = $nidz;

$display = 'default';
$my_content_view->build($display);
$content = $my_content_view->execute_display($display);
$output .= $content;

Where Fuzzysearchview is out view name.

$my_content_view->display["default"]->display_options["filters"]["nid_php"]["value"] = $nidz; This line tells the view to filter by the search output.

I know this is a dirty hack and one can do this better, but as I allready said, I had no more time....

#8

Priority:minor» normal

It would be slightly less hacky to do it like this:

1. Split off the fuzzysearch_process() function into more manageable functions so it would be possible to get an array of nids.
2. In the phpfilter call whatever function gets the array and implode the return array into the string.
3. Or create a views filter handler to take care of #2.

Once I get a stable release for D7 I'll take a look at this again.

#9

Subscribing:
Views provides a filter when the core Search module is enabled.
Fuzzy Search should provide one too.

#10

@system32_error:
Needed to get an n-gram search working with Views and couldn't go with Solr. This was an easy solution. Quick and dirty, but hey, it works. Thanks.

#11

The views integration is a really important point! Is there any work in progress regarding this?

Thank you for your great work! Subscribing.

#12

I have managed to add a Fuzzy Search functionality to views just by activating the module and using it's index.

In my case I needed to do a search on multiple fields so I added a computed field which concatenates all the data and in views I use that computed field for search. It works also if you use only one field.

It works fine for me but I think I have a PHP error related to this : http://drupal.org/node/1344620.

This was a lucky discovery maybe it will help people interested in fuzzy views search.

nobody click here