Created
September 17, 2012 20:52
-
-
Save tgruben/3739692 to your computer and use it in GitHub Desktop.
Issue with Parent Child counting
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
curl -XPOST http://localhost:9200/parent_child --data-binary @mapping.json | |
curl -XPOST http://localhost:9200/_bulk --data-binary @bulk.json | |
curl -XPOST http://localhost:9200/parent_child/profile/_search -d'{"query":{"has_child": {"query": {"term": {"tag": 110475388978628}}, "type": "segment"}}}' | |
curl -XPOST http://localhost:9200/parent_child/profile/_count -d'{"query":{"has_child": {"query": {"term": {"tag": 110475388978628}}, "type": "segment"}}}' |
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
{ "index" : { "_index" : "parent_child", "_type" : "profile", "_id" : "f92c0f92-354d-11e1-8104-12313806f111" } } | |
{"gender": "male", "profile_id": "f92c0f92-354d-11e1-8104-12313806f111", "property_id": 9} | |
{ "index" : { "_index" : "parent_child", "_type" : "segment", "parent" : "f92c0f92-354d-11e1-8104-12313806f111" } } | |
{"category": [0, 7], "tag": 183824211661952} | |
{ "index" : { "_index" : "parent_child", "_type" : "segment", "parent" : "f92c0f92-354d-11e1-8104-12313806f111" } } | |
{"category": [0, 3, 29, 327], "tag": 110475388978628} | |
{ "index" : { "_index" : "parent_child", "_type" : "segment", "parent" : "f92c0f92-354d-11e1-8104-12313806f111" } } | |
{"category": [0, 3, 29, 327], "tag": 28627688223} | |
{ "index" : { "_index" : "parent_child", "_type" : "segment", "parent" : "f92c0f92-354d-11e1-8104-12313806f111" } } | |
{"category": [0, 7], "tag": 8062627951} |
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
{ | |
"settings": { | |
"number_of_shards": 1, | |
"number_of_replicas": 1 | |
}, | |
"mappings": { | |
"profile": { | |
"properties": { | |
"property_id":{ | |
"type":"long" | |
}, | |
"profile_id": { | |
"type": "string", | |
"index":"not_analyzed" | |
}, | |
"gender": { | |
"type": "string", | |
"index":"not_analyzed" | |
} | |
} | |
}, | |
"segment": { | |
"_parent": { "type": "profile" }, | |
"_timestamp" : { "enabled" : true }, | |
"properties": { | |
"tag": { "type": "string" }, | |
"category": { "type": "long" } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment