Skip to content

Make _id overrideable to provide support for Gems like acts_as #974

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

Open
Fleick opened this issue Jan 20, 2021 · 2 comments
Open

Make _id overrideable to provide support for Gems like acts_as #974

Fleick opened this issue Jan 20, 2021 · 2 comments
Labels

Comments

@Fleick
Copy link

Fleick commented Jan 20, 2021

Hello all,

would it be possible to make the _id of Elasticsearch overridable by method? Unfortunately there are problems with gems that allows multi table inheritance (like acts_as), because model.id in elastichsearch.index_document takes the ID of the specific model - but the ID of the generic one would be necessary.
To take the first example from the Gem, we have to make sure that always the ID of Product is taken and not the one of Pen or Book. As far as I can see in the doc and in the Code line 112 there is currently no way to override _id.
To solve the problem in general I would recommend to create the possibility to implement a method _id on the model. This should override the default behavior.

@picandocodigo
Copy link
Member

Hi @Fleick,
Thanks for reporting this, I'll be working on this library soon after the release of the Elastic stack 7.11 and I'll take a look at this issue.

Cheers!

@Fleick
Copy link
Author

Fleick commented Oct 12, 2021

Hi @Fleick, Thanks for reporting this, I'll be working on this library soon after the release of the Elastic stack 7.11 and I'll take a look at this issue.

Cheers!

Hey @picandocodigo,
is there already an approximate schedule when to expect the processing? :)

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

2 participants