Hi all!
I'm newbie in elastic, please advice. I set up elastic v.0.19.11 on two VMs, summary I have 2 shards one on each VM. My mapping is:
http://10.112.1.10:9200/search/test/_mapping/?pretty=true
{
"test" : {
"_all" : {
"enabled" : false
},
"_id" : {
"path" : "RecordID"
},
"_routing" : {
"required" : true
},
"_source" : {
"enabled" : false
},
"properties" : {
"Date" : {
"type" : "date",
"index" : "analyzed",
"store" : "yes",
"format" : "date_time_no_millis"
},
"Name" : {
"type" : "string",
"analyzer" : "standard",
"store" : "yes"
},
"RecordID" : {
"type" : "string",
"index" : "not_analyzed",
"store" : "yes"
}
}
}
}
I'm using bulk indexing with meta like {"index":{ "_routing": 20121216 }} and {"index":{ "_routing": 20121217 }}.
My question is: when I run queries like
http://10.112.1.10:9200/search/test/_search/?q=:&fields=RecordID,_routing&size=1&pretty=true&routing=20121217
I get
{
"took" : 47,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 453184,
"max_score" : 1.0,
"hits" : [ {
"_index" : "search",
"_type" : "test",
"_id" : "16870466180",
"_score" : 1.0,
"fields" : {
"RecordID" : "16870466180",
"_routing" : "20121217"
}
} ]
}
}
or
http://10.112.1.10:9200/search/test/_search/?q=:&fields=RecordID,_routing&size=1&pretty=true&routing=20121216
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "search",
"_type" : "test",
"_id" : "1",
"_score" : 1.0,
"fields" : {
"RecordID" : "1",
"_routing" : "20121216"
}
} ]
}
}
seems looks fine. But when I tun, for example,
http://10.112.1.10:9200/search/test/_search/?q=:&fields=RecordID,_routing&size=1&pretty=true&routing=abcd
I get
{
"took" : 5,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 453184,
"max_score" : 1.0,
"hits" : [ {
"_index" : "search",
"_type" : "test",
"_id" : "16870466180",
"_score" : 1.0,
"fields" : {
"RecordID" : "16870466180",
"_routing" : "20121217"
}
} ]
}
}
Is it normal or I'm doing something wrong? Maybe this query mustn't return any results?
Thanks