-
Notifications
You must be signed in to change notification settings - Fork 118
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
index_name should accept a lambda in additional to a string #78
Comments
+1 |
Yes it's more complex than just a lambda evaluation, the underlying "cache" that avoids to call the |
Without the lambda support, how do we get the one-index-per-language to work? https://www.algolia.com/doc/guides/search/multilingual-search#option-1-one-index-per-language |
In such case (because from what I understand each object has its own language) I would recommend a 3rd option: what about pushing all the objects to a single index and tag them with the associated language: {
objectID: 42,
myattr: "my value",
[...],
_tags: ["language_en"]
} At search time, you could filter the search with a index.search("my query in english", { tagFilters: "language_en" }) How does that sound? |
Sorry, I wasn't specific in my original question. I'm using https://github.com/bithavoc/multilang-hstore and each object contains multiple languages for locale-aware attributes. I would need to search on these locale-aware attributes, i.e. So I guess a possible solution is to send all the locale aware attributes in flattened format and create slave indexes on them, and during search choose the right language index? E.g.
|
I have a similar use case, where every @redox in your opinion, is enabling to pass a lambda requires lots of work? If yes, is it significantly less performant to use the |
Actually @phildionne, for that you should rather go for 1 index and use the
The only issue I have adding the lambda is that the gem is also trying to keep the underlying index settings in sync with the one defined with the DSL in the |
Awesome! Thanks for pointing this out, works very well :) |
We are running into a similar situation where we need to dynamically define an index name (or at least an index prefix). We are currently using the Apartment gem to handle multiple schemas. For example, if we have a Blog model, the index will be named 'blog', but we need to prefix it with the current tenant/schema name, so 'schema_1_blog', 'schema_2_blog', etc. I was able to monkey patch the Any thoughts on a better way to handle this? Or are we pushing this gem to it's limits with our implementation? Thanks! |
Thanks for sharing that use-case with us. I personally didn't know about the Unfortunately, the current Let us know how that goes! |
No description provided.
The text was updated successfully, but these errors were encountered: