Cybertrunk
很奇怪。执行 GET my_blogs/_doc/comment2 能返回id为comment2的comment文档。但换成comment3却不行。
Query:
GET my_blogs/_doc/comment2
Result:
{
"_index" : "my_blogs",
"_type" : "_doc",
"_id" : "comment2",
"_version" : 1,
"_seq_no" : 5,
"_primary_term" : 1,
"_routing" : "blog2",
"found" : true,
"_source" : {
"comment" : "I like Hadoop!!!!!",
"username" : "Jack",
"blog_comments_relation" : {
"name" : "comment",
"parent" : "blog2"
}
}
}
Query:
GET my_blogs/_doc/comment3
Result:
{
"_index" : "my_blogs",
"_type" : "_doc",
"_id" : "comment3",
"found" : false
}
Query:
GET my_blogs/_doc/comment3?routing=blog2
Result:
{
"_index" : "my_blogs",
"_type" : "_doc",
"_id" : "comment3",
"_version" : 1,
"_seq_no" : 6,
"_primary_term" : 1,
"_routing" : "blog2",
"found" : true,
"_source" : {
"comment" : "Hello Hadoop",
"username" : "Bob",
"blog_comments_relation" : {
"name" : "comment",
"parent" : "blog2"
}
}
}
令人费解!