I created a new search method for "fuzzy" search, that means the keywords what you type matched in seperatly in node title with LIKE. This need 2 changes in the code in node_reference.module
Line 586:

      '#options'          => array(
        'starts_with'     => t('Starts with'),
        'contains'        => t('Contains'),
        'fuzzy'           => t('Fuzzy search'),
      ),

Line 855:

case 'fuzzy':
        $words = explode(' ', $options['string']);
        foreach ($words as $word) {
          $query->condition('n.title', '%' . $word . '%', 'LIKE');
        }
        break;

The name modification is welcome! I am thinking about the second % in like (maybe dont need it), because maybe good if only STARTS with keywords...

Please put this code in module

CommentFileSizeAuthor
#3 references-fuzzysearch-2082187-1.patch1.19 KBbsztreha
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bsztreha’s picture

Status: Reviewed & tested by the community » Needs review

Am i create a patch?

Alex Andrascu’s picture

Hi there,

Please do create a patch.

Thanks

bsztreha’s picture

Here is the patch
I did from dev version

bsztreha’s picture

Status: Needs review » Patch (to be ported)

Is there any update?

Alex Andrascu’s picture

Hi,

Sorry but i've very low on time lately. The plan, however is unchanged. I need to find some time to commit this patch.

Alex

Alex Andrascu’s picture

Version: 7.x-2.1 » 7.x-2.x-dev
Status: Patch (to be ported) » Fixed

Commited to 7.x-2.x-dev

Please test.

bsztreha’s picture

Status: Fixed » Closed (fixed)

I've installed the dev version, and works fine, thanks a lot! :)

gdebilde’s picture

Status: Closed (fixed) » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: references-fuzzysearch-2082187-1.patch, failed testing.

bsztreha’s picture

Issue summary: View changes

The test failed because: "Detect a non-applicable patch" ... of course this is an already applied patch.
Why is it necessary to change status to Needs review? I don't understand