Proper understanding of routing? Strange results on standard routing

I'm a little confused by results I'm seeing as far as routing. I set up an
index, add a routing mapping with required set to true on it, index my
documents, then do 2 searches, one with routing, the other without, but
both with a filter set to the routing field, and I get different hit
counts. I would of expected the routed one to of just been faster, am I not
understanding correctly? Here's the commands I used to set things up, I did
a standard bulk index to insert documents into the index.

Create index:

curl -XPUT 'http://sscasqaengtv01:9200/deals/' -d '
index :
number_of_shards : 5
number_of_replicas : 1
'

Create routing mapping:

curl -XPUT 'http://sscasqaengtv01:9200/deals/deal/_mapping' -d '
{
"deal" : {
"_routing" : {
"required": true,
"path": "deal.primaryDivision"
}
}
}
'

Then I switch the merge.policy.merge_factor to 30 and the
index.refresh_interval to -1, then run a bulk index with around 10 thousand
documents, each with a primaryDivision entry. Then I reset those index
settings.

After it's over, I run a flush and optimize command on the index, then I
run the following searches, expecting the same hit counts, but they are
different, the non routed one returns far more results than the routed one,
this doesn't make sense to me with my understanding of routing. What am I
missing?

I didn't care about the size, just was looking at hits with and without
routing specified
:
curl -XGET
'http://sscasqaengtv01:9200/deals/_search?routing=506f04d5e74bf118145369f3'
-d '{

"from": 0, "size": 1,
"fields": ["_id"],
"query": {
"filtered": { "query": { "term": { "primaryDivision":
"506f04d5e74bf118145369f3" } } }
}
}'

--

I think it may of been due to the mapping needed to be named deals instead
of deal.

On Friday, January 11, 2013 9:16:37 PM UTC-5, Darius Riggins wrote:

I'm a little confused by results I'm seeing as far as routing. I set up an
index, add a routing mapping with required set to true on it, index my
documents, then do 2 searches, one with routing, the other without, but
both with a filter set to the routing field, and I get different hit
counts. I would of expected the routed one to of just been faster, am I not
understanding correctly? Here's the commands I used to set things up, I did
a standard bulk index to insert documents into the index.

Create index:

curl -XPUT 'http://sscasqaengtv01:9200/deals/' -d '
index :
number_of_shards : 5
number_of_replicas : 1
'

Create routing mapping:

curl -XPUT 'http://sscasqaengtv01:9200/deals/deal/_mapping' -d '
{
"deal" : {
"_routing" : {
"required": true,
"path": "deal.primaryDivision"
}
}
}
'

Then I switch the merge.policy.merge_factor to 30 and the
index.refresh_interval to -1, then run a bulk index with around 10 thousand
documents, each with a primaryDivision entry. Then I reset those index
settings.

After it's over, I run a flush and optimize command on the index, then I
run the following searches, expecting the same hit counts, but they are
different, the non routed one returns far more results than the routed one,
this doesn't make sense to me with my understanding of routing. What am I
missing?

I didn't care about the size, just was looking at hits with and without
routing specified
:
curl -XGET '
http://sscasqaengtv01:9200/deals/_search?routing=506f04d5e74bf118145369f3'
-d '{

"from": 0, "size": 1,
"fields": ["_id"],
"query": {
"filtered": { "query": { "term": { "primaryDivision":
"506f04d5e74bf118145369f3" } } }
}
}'

--