0.90: search_string vs match_phrase_prefix: same query different results

I am trying the following two search queries in the recently released 0.90:

{
"query_string" : {
"query" : "object:Geo*"
}

and

{
"match_phrase_prefix" : {
"object" : "Geo"
}

The first one returns the correct total (53603472) and the second one
returns 11453280. An example doc that didn't match the second query and
should have: {"object":"Geo:Thailand:Bangkok"}

Mapping is just
{"properties":{"object":{"type":"string"}}}

What is causing the difference between the two queries?

Thanks!
Serge

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

For others finding this issue, I figured out the answer:

match_phrase_prefix by default sets the max_expansions to 50 (I had to
figure out this default value by trial and error -- not in the docs that I
could find).

after settings max_expansions to 1000, the two queries below became
equivalent:

{
"query_string" : {
"query" : "object:Geo*"
}

{
"match_phrase_prefix": {
"object": {
"query": "Geo",
"max_expansions": 1000
}
}
}

It looks like query_string's prefix format does not have a
max_expansions-like limit.

Hope this helps someone.

Serge

On Saturday, May 4, 2013 5:46:52 AM UTC-4, Serge Aluker wrote:

I am trying the following two search queries in the recently released 0.90:

{
"query_string" : {
"query" : "object:Geo*"
}

and

{
"match_phrase_prefix" : {
"object" : "Geo"
}

The first one returns the correct total (53603472) and the second one
returns 11453280. An example doc that didn't match the second query and
should have: {"object":"Geo:Thailand:Bangkok"}

Mapping is just
{"properties":{"object":{"type":"string"}}}

What is causing the difference between the two queries?

Thanks!
Serge

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.