Created
March 20, 2013 17:04
-
-
Save eranid/5206390 to your computer and use it in GitHub Desktop.
has_child query fails with "does not have parent mapping"
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 -XGET 'http://localhost:9200/index1/child_type/_mapping?pretty=true' | |
{ | |
"child_type" : { | |
"_parent" : { | |
"type" : "parent_type" | |
}, | |
"_routing" : { | |
"required" : true | |
}, | |
"_timestamp" : { | |
"enabled" : true | |
}, | |
"properties" : { | |
"field1" : { | |
"type" : "string" | |
}, | |
} | |
} | |
} | |
curl -XPOST 'http://localhost:9200/index1/parent_type/_search?pretty=true' -d '{ | |
"query": { | |
"has_child": { | |
"type": "child_type", | |
"query": { | |
"match_all": {} | |
} | |
} | |
} | |
}' | |
{ | |
"error" : "SearchPhaseExecutionException[Failed to execute phase [query_fetch], total failure; shardFailures {[koaRL5w_QXuzLPV4QMgL6w][index1][0]: SearchParseException[[index1][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"query\": {\n \"has_child\": {\n \"type\": \"child_type\",\n \"query\": {\n \"match_all\": {}\n }\n }\n }\n}]]]; nested: QueryParsingException[[index1] [has_child] Type [child_type] does not have parent mapping]; }]", | |
"status" : 500 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment