Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | references-fuzzysearch-2082187-1.patch | 1.19 KB | bsztreha |
Comments
Comment #1
bsztreha CreditAttribution: bsztreha commentedAm i create a patch?
Comment #2
Alex Andrascu CreditAttribution: Alex Andrascu commentedHi there,
Please do create a patch.
Thanks
Comment #3
bsztreha CreditAttribution: bsztreha commentedHere is the patch
I did from dev version
Comment #4
bsztreha CreditAttribution: bsztreha commentedIs there any update?
Comment #5
Alex Andrascu CreditAttribution: Alex Andrascu commentedHi,
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
Comment #6
Alex Andrascu CreditAttribution: Alex Andrascu commentedCommited to 7.x-2.x-dev
Please test.
Comment #7
bsztreha CreditAttribution: bsztreha commentedI've installed the dev version, and works fine, thanks a lot! :)
Comment #8
gdebilde CreditAttribution: gdebilde commented3: references-fuzzysearch-2082187-1.patch queued for re-testing.
Comment #10
bsztreha CreditAttribution: bsztreha commentedThe 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