Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELETE /gangs
- GET /gangs
- PUT /gangs
- {
- "settings": {
- "index.mapping.coerce": false,
- "index.mapper.dynamic": false
- },
- "mappings": {
- "gang": {
- "properties": {
- "name": {
- "type": "keyword"
- },
- "description": {
- "type": "text"
- }
- }
- },
- "territory": {
- "_parent": {
- "type": "gang"
- },
- "properties": {
- "name": {
- "type": "keyword"
- },
- "coordinate": {
- "type": "object",
- "properties": {
- "x": { "type": "integer" },
- "y": { "type": "integer" }
- }
- }
- }
- },
- "entity": {
- "_parent": {
- "type": "gang"
- },
- "properties": {
- "name": {
- "type": "keyword"
- }
- }
- }
- }
- }
- PUT /gangs/gang/gang1?refresh=true
- {
- "name": "test1"
- }
- PUT /gangs/gang/gang2?refresh=true
- {
- "name": "test2"
- }
- PUT /gangs/territory/territory1?parent=gang1&refresh=true
- {
- "name": "territory1",
- "coordinate": {
- "x": 10,
- "y": 11
- }
- }
- GET /gangs/_search
- {
- "query": {
- "parent_id" : {
- "type" : "gang",
- "id" : "gang1"
- }
- }
- }
- GET /gangs/_search
- {
- "query": {
- "has_parent": {
- "parent_type": "gang",
- "query": {
- "term": {
- "_id": "gang1"
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement