On Wed, 2013-02-20 at 03:33 -0800, JJack_PL wrote:
Example from page:
"match_phrase_prefix" : {
"message" : {
"query" : "this is a test",
"max_expansions" : 10
}
}
Can you give me some simple examples on this with different max_expansions numbers for example for query "a" and multi characters query like "test"?
In the example above, ES will examine all terms in the "message" field
to look for those that begin with the letters "test". It will combine
all of those terms into a query (eg "test","tester","testing","tests"
etc), working in alphabetical (lexicographic) order, up to
max_expansions.
Set max_expansions to limit the number of terms that will be collected.
Eg, if the prefix is "a" you may end up with thousands of terms, which
is pretty meaningless. Set max_expansions to (eg) 30 so that the user
gets some response, but your server is not overwhelmed by too many
clauses.
In the above example if there are documents with terms : "test","tester","testing","tests"
and we are querying for "test" and "max_expansions" : 2, should it return only first 2 matching docs?
I see that it is returning all the matching docs. Could you please explain?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.