Inconsistent results for the text_phrase_prefix search

I seem to be getting inconsistent/unpredictable results for the
text_phrase_prefix search on 0.17.8 that im using for an
autocomplete. I have supplied an example in the following gist.
Maybe I'm miss understanding how the query works.

Please note that each time i delete and recreate this index I'm
getting different results for the text_phrase_prefix search examples
in the gist. Should they be consistent?

Thanks

Frazer

This realtes to the document distributed across the shards. You use auto
generates ids, which means each time, the documents will end up in different
shards. Thats fine, but, a score of a document is, by default, computed
against the documents that exists within the same shard (its "local" to the
shard). If you want more "correct" results, with scoring the spans the
cluster, you can set the search_type to dfs_query_then_fetch, though, it is
a slower search.

On Wed, Oct 12, 2011 at 2:53 PM, frazer frazer.horn@gmail.com wrote:

I seem to be getting inconsistent/unpredictable results for the
text_phrase_prefix search on 0.17.8 that im using for an
autocomplete. I have supplied an example in the following gist.
Maybe I'm miss understanding how the query works.

https://gist.github.com/1281147

Please note that each time i delete and recreate this index I'm
getting different results for the text_phrase_prefix search examples
in the gist. Should they be consistent?

Thanks

Frazer

Hi Kimchy,

I am facing same kind of issue without specifying the max_expansion. From the document I understood that "unbound" is the default for max_expansion.

I have around 5000000 of records and I am using text_phrase_prefix WITHOUT max_expansion. But when I search for single word it resulted properly. But the when I do the search with multiple words with partial second or third word like "San f" then I am not getting the result even I am not getting any max clause exception. If I have set the max_expansion to 10000 then results are coming properly.

Why default value "unbound" is not considered for max_expansion. I would appreciate your suggestion for this.

Note: I am using latest Elastic Search Version.

Thanks