Copy_to and boost factor

Hi,

Does the individual boost factor get honoured for fields getting copied
into a custom _all field via copy_to option?
I am facing issues with the behavior. Have a look at the example below

PUT localhost:9200/investigations/TestCustom/_mapping
{
"TestCustom": {
"properties": {
"custom_all":{
"type": "string"
},
"name":{
"type": "string",
"copy_to":"custom_all",
"boost":2.0
},
"surName":{
"type": "string",
"copy_to":"custom_all"
},
"dateRecorded":{
"type": "date",
"copy_to":"custom_all"
},
"Id":{
"type": "long",
"copy_to":"custom_all"
}
}
}
}

Fiels "name" has been given a boost factor of 2.0

I post 2 documents now

POST localhost:9200/investigations/TestCustom/5
{
"surName":"Preeti"
}
POST localhost:9200/investigations/TestCustom/6
{
"name":"Preeti"
}

and then search the custom_all field

GET localhost:9200/investigations/TestCustom/_search
{
"query":{
"query_string": {
"default_field": "custom_all",
"query": "Preeti"
}
}
}

I expected document with id 6 to be the top result but the results were

{
"took": 40,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "investigations",
"_type": "TestCustom",
"_id": "5",
"_score": 1,
"_source": {
"surName": "Preeti"
}
},
{
"_index": "investigations",
"_type": "TestCustom",
"_id": "6",
"_score": 1,
"_source": {
"name": "Preeti"
}
}
]
}
}

Is this expected behavior?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/79af9adb-5dce-4a7a-897b-16cd962c8a40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Boosting is not supported in copy_to, see

Alternative, as quoted from the commit message

"Instead, users should either (1) query the common field AND the field that
requires boosting, or (2) the multi_match query will soon be able to
perform term-centric cross-field matching that will allow per-field
boosting at query time (coming in 1.1)."

See my multi_match gist for an example

Jörg

On Tue, Dec 30, 2014 at 9:36 AM, Preeti Jain itspreeti@gmail.com wrote:

Hi,

Does the individual boost factor get honoured for fields getting copied
into a custom _all field via copy_to option?
I am facing issues with the behavior. Have a look at the example below

PUT localhost:9200/investigations/TestCustom/_mapping
{
"TestCustom": {
"properties": {
"custom_all":{
"type": "string"
},
"name":{
"type": "string",
"copy_to":"custom_all",
"boost":2.0
},
"surName":{
"type": "string",
"copy_to":"custom_all"
},
"dateRecorded":{
"type": "date",
"copy_to":"custom_all"
},
"Id":{
"type": "long",
"copy_to":"custom_all"
}
}
}
}

Fiels "name" has been given a boost factor of 2.0

I post 2 documents now

POST localhost:9200/investigations/TestCustom/5
{
"surName":"Preeti"
}
POST localhost:9200/investigations/TestCustom/6
{
"name":"Preeti"
}

and then search the custom_all field

GET localhost:9200/investigations/TestCustom/_search
{
"query":{
"query_string": {
"default_field": "custom_all",
"query": "Preeti"
}
}
}

I expected document with id 6 to be the top result but the results were

{
"took": 40,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "investigations",
"_type": "TestCustom",
"_id": "5",
"_score": 1,
"_source": {
"surName": "Preeti"
}
},
{
"_index": "investigations",
"_type": "TestCustom",
"_id": "6",
"_score": 1,
"_source": {
"name": "Preeti"
}
}
]
}
}

Is this expected behavior?

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/79af9adb-5dce-4a7a-897b-16cd962c8a40%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/79af9adb-5dce-4a7a-897b-16cd962c8a40%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFoMaubLqX%2BhODrq74mKtM33%2BAojT8NrDNO%2BpumtDHNCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thanks Jörg.

On Tuesday, December 30, 2014 2:43:20 PM UTC+5:30, Jörg Prante wrote:

Boosting is not supported in copy_to, see

https://github.com/elasticsearch/elasticsearch/pull/4972

Alternative, as quoted from the commit message

"Instead, users should either (1) query the common field AND the field
that requires boosting, or (2) the multi_match query will soon be able to
perform term-centric cross-field matching that will allow per-field
boosting at query time (coming in 1.1)."

See my multi_match gist for an example

https://gist.github.com/jprante/85126685973311603c8a

Jörg

On Tue, Dec 30, 2014 at 9:36 AM, Preeti Jain <itsp...@gmail.com
<javascript:>> wrote:

Hi,

Does the individual boost factor get honoured for fields getting copied
into a custom _all field via copy_to option?
I am facing issues with the behavior. Have a look at the example below

PUT localhost:9200/investigations/TestCustom/_mapping
{
"TestCustom": {
"properties": {
"custom_all":{
"type": "string"
},
"name":{
"type": "string",
"copy_to":"custom_all",
"boost":2.0
},
"surName":{
"type": "string",
"copy_to":"custom_all"
},
"dateRecorded":{
"type": "date",
"copy_to":"custom_all"
},
"Id":{
"type": "long",
"copy_to":"custom_all"
}
}
}
}

Fiels "name" has been given a boost factor of 2.0

I post 2 documents now

POST localhost:9200/investigations/TestCustom/5
{
"surName":"Preeti"
}
POST localhost:9200/investigations/TestCustom/6
{
"name":"Preeti"
}

and then search the custom_all field

GET localhost:9200/investigations/TestCustom/_search
{
"query":{
"query_string": {
"default_field": "custom_all",
"query": "Preeti"
}
}
}

I expected document with id 6 to be the top result but the results were

{
"took": 40,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "investigations",
"_type": "TestCustom",
"_id": "5",
"_score": 1,
"_source": {
"surName": "Preeti"
}
},
{
"_index": "investigations",
"_type": "TestCustom",
"_id": "6",
"_score": 1,
"_source": {
"name": "Preeti"
}
}
]
}
}

Is this expected behavior?

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/79af9adb-5dce-4a7a-897b-16cd962c8a40%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/79af9adb-5dce-4a7a-897b-16cd962c8a40%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/54ed8625-a8bc-4be4-b48a-18b364d51a66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.