What I don't understand is why I get different results with these 2 queries:
Let _all = field_1, field_2, field_3
Query 1:
multi_match:
{
fields: ["_all"],
query: "a test query",
operator: "and",
analyzer: "my_analyzer"
}
Query 2:
multi_match:
{
fields["field_1", "field_2", field_3"]
query: "a test query",
operator: "and",
analyzer: "my_analyzer"
}
The behavior in Query 2 is different from Query 1, and as far as I
understand the reason is that with Query 2 the results must have
query in any of the fields provided but with no combinations (eg. "a" found
in field_1, "test" found in field_2 etc). Is this correct?
(elasticsearch version 0.19.12)
On Wednesday, January 30, 2013 12:09:18 PM UTC+2, Clinton Gormley wrote:
On Wed, 2013-01-30 at 10:44 +0100, Martijn v Groningen wrote:
Yes, that is effectively the same. If you're using the multi_match
query then you are more flexible, you can change fields you query by
at any time. On top of this you can nicely play with different boosts
per field when using the multi_match
query.
Note also that the term frequencies and field length may be different in
the _all field and in the individual fields, which may affect scoring.
clint
--
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.