Coder Social home page Coder Social logo

Comments (3)

martinstreicher avatar martinstreicher commented on September 27, 2024

I will note that if you explicitly include Elasticsearch::Model in both classes, both classes are added to the registry.

from elasticsearch-rails.

martinstreicher avatar martinstreicher commented on September 27, 2024

I do see this in the README:

Versions < 7.0.0 of this gem supported inheritance-- more specifically, Single Table Inheritance. With this feature,
elasticsearch settings (index mappings, etc) on a parent model could be inherited by a child model leading to different
model documents being indexed into the same Elasticsearch index. This feature depended on the ability to set a type
for a document in Elasticsearch. The Elasticsearch team has deprecated support for types, as is described
here.
This gem will also remove support for types and Single Table Inheritance in version 7.0 as it enables an anti-pattern.
Please save different model documents in separate indices. If you want to use STI, you can include an artificial
type field manually in each document and use it in other operations.

Does this apply to subclasses outside of STI? I suppose it might.

from elasticsearch-rails.

martinstreicher avatar martinstreicher commented on September 27, 2024

A proposed PR is here: https://github.com/elastic/elasticsearch-rails/pull/1073/files -- if this is a valid issue and repair, I will add tests to the PR. I signed the contributor's agreement.

from elasticsearch-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.