Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Fuzzy search with international fields #29

Open
abournier opened this issue Dec 16, 2013 · 0 comments
Open

Fuzzy search with international fields #29

abournier opened this issue Dec 16, 2013 · 0 comments

Comments

@abournier
Copy link
Contributor

Hello,

I have a bad fuzzy result if I use a model with international fields.

Model:

class Category < ActiveRecord::Base
fuzzily_searchable :name_fr, :name_en, :name_de, :name_es, :name_it
end

Fill the trigrams:

Category.bulk_update_fuzzy_name_en
Category.bulk_update_fuzzy_name_fr
Category.bulk_update_fuzzy_name_de
Category.bulk_update_fuzzy_name_es
Category.bulk_update_fuzzy_name_it 

Fuzzily search:

category = Category.find_by_fuzzy_name('rouge', :limit => 1).first
=> gives me "rose" as result

What I need to do:
category = Category.find_by_fuzzy_name_fr('rouge', :limit => 1).first
=> gives me "rouge" as result

So I need to set the language in the search method to catch the right result.
The problem is I want to make the search to work without knowing the language.

Is-this possible ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant