Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algolia with globalize gem #283

Open
jonhue opened this issue Dec 9, 2017 · 5 comments
Open

Algolia with globalize gem #283

jonhue opened this issue Dec 9, 2017 · 5 comments
Labels

Comments

@jonhue
Copy link
Contributor

jonhue commented Dec 9, 2017

I am using the globalize gem in my app, to translate a couple of columns in my database tables.

When Algolia indexes them, it only pics up the English translation.
That leads to a problem, when a user uses another language and tries to search for some records.

Is Algolia able to handle records with attributes, that have multiple translations - and then utilize one of them when a search occurs?

@casiodk
Copy link

casiodk commented Mar 4, 2018

+1 Is there any progress here. What is the recomended way for indexing multiple indices per locale?

@severin
Copy link

severin commented Mar 15, 2018

+1 also interested in this

@jonhue
Copy link
Contributor Author

jonhue commented Mar 23, 2018

@redox Is there a way to perform globalized searches with Algolia?

@redox redox added the question label Mar 26, 2018
@redox
Copy link
Contributor

redox commented Mar 26, 2018

Hey @jonhue @casiodk @severin;

sorry for being late here... I've never used the globalize gem so I don't have a lot of insights; but I assume having something like the following should work:

algoliasearch do
  [:en, :fr, :de].each do |lang|
    add_attribute "title_#{lang}" do
      Globalize.with_locale(lang) do
          title
      end
    end
  end
end

What do you think?

@Spone
Copy link
Contributor

Spone commented Feb 14, 2019

The best way to handle this in my opinion is to have one index per locale, but the syntax is clearly too complicated currently, see #307

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

No branches or pull requests

5 participants