Git Product home page Git Product logo

Comments (8)

vcostin avatar vcostin commented on August 26, 2024 1

@ebisrat I have been focused on other things at the time, sorry I've dropped this experiment, shame on me. But I'm still interested in the nested data/indexes feature in elastic. MySQL db that I wished to index didn't had indexed relations just software implementation for relation by keys. I need a mechanism to describe explicit what field from what table and from what schema are related.

from go-mysql-elasticsearch.

EagleChen avatar EagleChen commented on August 26, 2024 1

@delkant

As far as I know, for ES 6.x, 'join' only supports parent-child relationships for the same type in the same index.

But in most cases, in relational database, 'parent' and 'child' are different tables(types).

So it's no longer suitable to mapping relationship from RDB directly to ES 6.x.

Here are some references: type removal, join

from go-mysql-elasticsearch.

siddontang avatar siddontang commented on August 26, 2024

Hi @vcostin

I have not used nested indices before, now we support a simple parent feature https://github.com/siddontang/go-mysql-elasticsearch#rule supported by @EagleChen

Does your table blog has a user_id column?

from go-mysql-elasticsearch.

vcostin avatar vcostin commented on August 26, 2024

Hi @siddontang

blog is not a table it's the db schema name, table posts has the user_id field.

I tried to define parent relation in elastic but I had same results.

from go-mysql-elasticsearch.

siddontang avatar siddontang commented on August 26, 2024

/cc @EagleChen could you help me to figure this out?

from go-mysql-elasticsearch.

EagleChen avatar EagleChen commented on August 26, 2024

@vcostin @siddontang

First, it seems to me that the "parent" and "child" types should be in the same index. But they are in different indexes in your case. ( I might be wrong. You can find more information on the official website of ElasticSearch. )

Second, you might have forgotten to define the _parent field for ElasticSearch.
When creating the post type in ES, you need to explicitly set the parent to user type like this:

  "post" : {
      "_parent" : {
        "type" : "user"
      },
  ....

Hope this will help you.

from go-mysql-elasticsearch.

ebisrat avatar ebisrat commented on August 26, 2024

@vcostin Did you find a solution to this? If so, any suggestions would be a great help.

from go-mysql-elasticsearch.

delkant avatar delkant commented on August 26, 2024

_parent HAS BEEN REMOVED IN ES 6.2

_parent
The _parent field has been removed in favour of the join field.

How can I define relationship with ES 6.2 ?? are you planning to support JOINs.

from go-mysql-elasticsearch.

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.