Multi_match Vs match _all

hi,
If N fields (and only these) included in _all field then a multi_match
query in N fields should be the same with a match query in _all field (with
the same options) ?
In which situations the above could be false?
thanks,
g.

--
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.

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.

On 29 January 2013 23:26, Giorgos Tsiftsis giorgos.tsiftsis@gmail.com wrote:

hi,
If N fields (and only these) included in _all field then a multi_match
query in N fields should be the same with a match query in _all field (with
the same options) ?
In which situations the above could be false?
thanks,
g.

--
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.

--
Met vriendelijke groet,

Martijn van Groningen

--
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.

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.

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.

Correct, in the case for query 2 for a document to have a hit, the
document needs all the hits in either field_1, field_2 or field_2. In
the first query the combination of hits can span a cross those fields.
In my initial response to your case I was assuming using the or
operator (which is or)

Also do the _all field and the other fields have the same index time
analyzer? This is must be the same if you want the same behaviour for
both queries.

Martijn

On 30 January 2013 12:23, Giorgos Tsiftsis giorgos.tsiftsis@gmail.com wrote:

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.

--
Met vriendelijke groet,

Martijn van Groningen

--
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.