Comments (8)
@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.
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.
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.
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.
/cc @EagleChen could you help me to figure this out?
from go-mysql-elasticsearch.
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.
@vcostin Did you find a solution to this? If so, any suggestions would be a great help.
from go-mysql-elasticsearch.
_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)
- 同步多表怎么写配置 HOT 1
- Sync error consider adding an alarm
- 同步过程中服务老是出现停的情况,错误 [error] river.go:315 start canal err ERROR 1236 (HY000): A slave with the same server_uuid/server_id as this slave has connected to the master; the first event 'mysql-bin.000470' at 775402324, the last event read from './mysql-bin.000470' at 882910125, the last byte read from './mysql-bin.000470' at 882910125. HOT 1
- es 7 使用 Parent-Child Relationship
- how can I sync mysql which in docker container to elasticsearch?
- binlog error on restart (invalid character 'R' after top-level value)
- 执行exe同步报错 invalid sequence 8!=1 HOT 2
- 多个子表聚合到一个index
- 能支持dockerfile
- 能否同步one-many嵌套表作为对象关联 到es中?需要怎么配置
- 无法实现同步
- 你好,同步报错如下:sync.go:156 do ES bulk err invalid character '<' looking for beginning of value, close sync HOT 1
- mysql8 mysqldump出错 HOT 1
- 阿里云/腾讯云 mysql to es WITH MAX_USER_CONNECTIONS 10000 HOT 1
- mysql,datetime字段同步到ES的date字段,会变成加8时区的格式 HOT 1
- How do I connect to an ES cluster HOT 1
- Startup error
- start canal err line 1 column 29 near "ON *.* FROM 'root'@'%'"
- go mod tidy HOT 1
- MySql int filed to ES text filed.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-mysql-elasticsearch.