Skip to content

Instantly share code, notes, and snippets.

@serj-p
Created October 15, 2012 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save serj-p/3893320 to your computer and use it in GitHub Desktop.
Save serj-p/3893320 to your computer and use it in GitHub Desktop.
ES query and mapping for failing parent/child request
{
"timeout": 180000,
"query": {
"filtered": {
"filter": {
"and": {
"filters": [
{
"term": {
"company_id": "4d07f9c8775911968cab4a80"
}
},
{
"has_child": {
"query": {
"filtered": {
"filter": {
"and": [
{
"term": {
"company_id": "4d07f9c8775911968cab4a80"
}
},
{
"term": {
"name": "twitter"
}
}
]
},
"query": {
"match_all": {
}
}
}
},
"type": "tag"
}
}
]
}
},
"query": {
"bool": {
"must": [
{
"match_all": {
}
}
],
"should": [
]
}
}
}
}
}
{
"contacts_v2": {
"tag": {
"dynamic": "false",
"_all": {
"enabled": false
},
"_parent": {
"type": "contact"
},
"_routing": {
"required": true
},
"_source": {
"enabled": false
},
"properties": {
"company_id": {
"type": "string",
"index": "not_analyzed"
},
"name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"reverse_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"tag_id": {
"type": "string",
"index": "not_analyzed"
}
}
},
"contact": {
"dynamic": "false",
"_all": {
"enabled": false
},
"_source": {
"enabled": false
},
"properties": {
"any_fields": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true,
"include_in_all": false
},
"company_id": {
"type": "string",
"index": "not_analyzed"
},
"created": {
"type": "date",
"format": "yyyy-MM-dd'T'HH:mm:ssZ"
},
"custom_fields": {
"type": "nested",
"dynamic": "false",
"include_in_all": false,
"properties": {
"id": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true,
"include_in_all": false
},
"reverse_value": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true,
"include_in_all": false
},
"value": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true,
"include_in_all": false
}
}
},
"fields": {
"dynamic": "false",
"properties": {
"accountNumber": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"assistant": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"assistantPhone": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"city": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"company_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"country": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"dates": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"department": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"description": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"email": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"facebook": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_id": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"first_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"last_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"leadSource": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"leadType": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"linkedin": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_id": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"phone": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"skype": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"state": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"street": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"title": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"twitter": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_id": {
"type": "string",
"index": "not_analyzed"
},
"user_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"website": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"zip": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"id": {
"type": "string",
"store": "yes"
},
"is_account": {
"type": "boolean",
"index": "not_analyzed"
},
"owner_id": {
"type": "string",
"index": "not_analyzed"
},
"reverse_any_fields": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true,
"include_in_all": false
},
"reverse_fields": {
"dynamic": "false",
"properties": {
"accountNumber": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"assistant": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"assistantPhone": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"city": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"company_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"country": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"dates": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"department": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"description": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"email": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"facebook": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_id": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"first_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"last_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"leadSource": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"leadType": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"linkedin": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_id": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"phone": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"skype": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"state": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"street": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"title": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"twitter": {
"dynamic": "false",
"properties": {
"profile": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"user_id": {
"type": "string",
"index": "not_analyzed"
},
"user_name": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
},
"website": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
},
"zip": {
"type": "string",
"index": "not_analyzed",
"omit_term_freq_and_positions": true
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment