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

How does this gem handle i18n? #10

Open
sintro opened this issue May 3, 2016 · 1 comment
Open

How does this gem handle i18n? #10

sintro opened this issue May 3, 2016 · 1 comment

Comments

@sintro
Copy link

sintro commented May 3, 2016

It is common problem for different search implementations to do multilanguage searching, or to support correct indexing of associated tables (so, the Globalize implementation of multilanguage system will be the problem).
Refinery uses Globalize to implement i18n, and I am interested, how does this gem will handle the searching among associated 'page_translations' table, or 'post_translations'.

For example, to make the searching using 'pg_search' gem, one have to make something like

  pg_search_scope :search,
                  associated_against: {
                      :translations => [:title, :body]
                  }

And sadly, when using associated_against option (to search in associated models, which translations table is) there is no indices support (so in future searching can be a big hole in security of website).

@datenimperator
Copy link
Member

This gem feeds data from the Ruby models into Elasticsearch by translating them to JSON. This happens in the decorators for each model. That way this gem is different eg from pg_search which helps building SQL queries.

Generally, indexing different locales shouldn't be a problem with Elasticsearch. I haven't tried it though and I'm not sure how to handle the available locales during indexing and search. How is this supposed to happen?

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

No branches or pull requests

2 participants