Last active
June 28, 2017 05:23
-
-
Save yanglikun/81428d2be22211b69c8b85cefb3aeaec to your computer and use it in GitHub Desktop.
es-关联关系-object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE relation_object_index | |
PUT /relation_object_index/relation_object_type/1 | |
{ | |
"projectName": "train", | |
"members": [ | |
{ | |
"firstName":"san", | |
"lastName":"zhang" | |
},{ | |
"firstName":"si", | |
"lastName":"li" | |
} | |
] | |
} | |
PUT /relation_object_index/relation_object_type/2 | |
{ | |
"projectName": "airplane", | |
"members": [ | |
{ | |
"firstName":"wu", | |
"lastName":"wang" | |
},{ | |
"firstName":"liu", | |
"lastName":"zhao" | |
} | |
] | |
} | |
GET /relation_object_index/_mapping | |
GET /relation_object_index/_search | |
#because store as flat | |
GET /relation_object_index/_search | |
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"members.lastName": { | |
"value": "zhang" | |
} | |
} | |
}, | |
{ | |
"term": { | |
"members.firstName": { | |
"value": "si" | |
} | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment