Sort by only '_boost'

Hi all.
I am implementing keyword search function. For this I have declared mapping
as following.

{
"fulltext":{
"_boost":{
"name":"weight",
"null_value":1.0
},
"properties":{
"musicId":{
"type":"integer",
"index":"not_analyzed",
"store":"true"
},
"title":{
"type":"string",
"index":"analyzed",
"store":"true",
"analyzer":"cjk"
},
"weight":{
"type":"double",
"index":"not_analyzed",
"store":"true"
}
}
}
}

Next, I have put as following docs.

musicId(1), title("あい"), weight(10)
musicId(2), title("あいあい"), weight(20)
musicId(3), title("あいあいあい"), weight(30)
musicId(4), title("あいあいあいあい"), weight(40)

When, then, I searched by the keyword 'あい', output was as following.

musicId=2
title=あいあい
weight=20.0

musicId=3
title=あいあいあい
weight=30.0

musicId=4
title=あいあいあいあい
weight=40.0

musicId=1
title=あい
weight=10.0

I expected a doc that has higher boost value will be matched at top but it
does not.
Give me some advice please.

Thanks for reading.

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

Does anyone have some ideas?

2013년 11월 19일 화요일 오후 4시 9분 54초 UTC+9, Min Cha 님의 말:

Hi all.
I am implementing keyword search function. For this I have declared
mapping as following.

{
"fulltext":{
"_boost":{
"name":"weight",
"null_value":1.0
},
"properties":{
"musicId":{
"type":"integer",
"index":"not_analyzed",
"store":"true"
},
"title":{
"type":"string",
"index":"analyzed",
"store":"true",
"analyzer":"cjk"
},
"weight":{
"type":"double",
"index":"not_analyzed",
"store":"true"
}
}
}
}

Next, I have put as following docs.

musicId(1), title("あい"), weight(10)
musicId(2), title("あいあい"), weight(20)
musicId(3), title("あいあいあい"), weight(30)
musicId(4), title("あいあいあいあい"), weight(40)

When, then, I searched by the keyword 'あい', output was as following.

musicId=2
title=あいあい
weight=20.0

musicId=3
title=あいあいあい
weight=30.0

musicId=4
title=あいあいあいあい
weight=40.0

musicId=1
title=あい
weight=10.0

I expected a doc that has higher boost value will be matched at top but it
does not.
Give me some advice please.

Thanks for reading.

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

Try to add explain: true to your query to see how score is computed.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 nov. 2013 à 02:52, Min Cha minslovey@gmail.com a écrit :

Does anyone have some ideas?

2013년 11월 19일 화요일 오후 4시 9분 54초 UTC+9, Min Cha 님의 말:

Hi all.
I am implementing keyword search function. For this I have declared mapping as following.

{
"fulltext":{
"_boost":{
"name":"weight",
"null_value":1.0
},
"properties":{
"musicId":{
"type":"integer",
"index":"not_analyzed",
"store":"true"
},
"title":{
"type":"string",
"index":"analyzed",
"store":"true",
"analyzer":"cjk"
},
"weight":{
"type":"double",
"index":"not_analyzed",
"store":"true"
}
}
}
}

Next, I have put as following docs.

musicId(1), title("あい"), weight(10)
musicId(2), title("あいあい"), weight(20)
musicId(3), title("あいあいあい"), weight(30)
musicId(4), title("あいあいあいあい"), weight(40)

When, then, I searched by the keyword 'あい', output was as following.

musicId=2
title=あいあい
weight=20.0

musicId=3
title=あいあいあい
weight=30.0

musicId=4
title=あいあいあいあい
weight=40.0

musicId=1
title=あい
weight=10.0

I expected a doc that has higher boost value will be matched at top but it does not.
Give me some advice please.

Thanks for reading.

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

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

https://groups.google.com/forum/?fromgroups#!searchin/elasticsearch/Min$20Cha|sort:date/elasticsearch/39L7hXJR8GY/gRJRiiASat0J

ES supports custom score script so if I wants to sort only _boost value, I
can use script as "source._boost" in script.
It`s simple and works fine.

Example : {"query":{"custom_score":{"query":{"query_string":{"
query":"title:"Love""}},"script":"_source.boost"}}}

2013년 11월 19일 화요일 오후 4시 9분 54초 UTC+9, Min Cha 님의 말:

Hi all.
I am implementing keyword search function. For this I have declared
mapping as following.

{
"fulltext":{
"_boost":{
"name":"weight",
"null_value":1.0
},
"properties":{
"musicId":{
"type":"integer",
"index":"not_analyzed",
"store":"true"
},
"title":{
"type":"string",
"index":"analyzed",
"store":"true",
"analyzer":"cjk"
},
"weight":{
"type":"double",
"index":"not_analyzed",
"store":"true"
}
}
}
}

Next, I have put as following docs.

musicId(1), title("あい"), weight(10)
musicId(2), title("あいあい"), weight(20)
musicId(3), title("あいあいあい"), weight(30)
musicId(4), title("あいあいあいあい"), weight(40)

When, then, I searched by the keyword 'あい', output was as following.

musicId=2
title=あいあい
weight=20.0

musicId=3
title=あいあいあい
weight=30.0

musicId=4
title=あいあいあいあい
weight=40.0

musicId=1
title=あい
weight=10.0

I expected a doc that has higher boost value will be matched at top but it
does not.
Give me some advice please.

Thanks for reading.

--
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/96e85231-6341-4919-adc8-af0273824777%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Why not simply sort on the weight field?

--
Ivan

On Wed, Dec 4, 2013 at 1:44 AM, Min Cha minslovey@gmail.com wrote:

Redirecting to Google Groups

ES supports custom score script so if I wants to sort only _boost value, I
can use script as "source._boost" in script.
It`s simple and works fine.

Example : {"query":{"custom_score":{"query":{"query_string":{"
query":"title:"Love""}},"script":"_source.boost"}}}

2013년 11월 19일 화요일 오후 4시 9분 54초 UTC+9, Min Cha 님의 말:

Hi all.
I am implementing keyword search function. For this I have declared
mapping as following.

{
"fulltext":{
"_boost":{
"name":"weight",
"null_value":1.0
},
"properties":{
"musicId":{
"type":"integer",
"index":"not_analyzed",
"store":"true"
},
"title":{
"type":"string",
"index":"analyzed",
"store":"true",
"analyzer":"cjk"
},
"weight":{
"type":"double",
"index":"not_analyzed",
"store":"true"
}
}
}
}

Next, I have put as following docs.

musicId(1), title("あい"), weight(10)
musicId(2), title("あいあい"), weight(20)
musicId(3), title("あいあいあい"), weight(30)
musicId(4), title("あいあいあいあい"), weight(40)

When, then, I searched by the keyword 'あい', output was as following.

musicId=2
title=あいあい
weight=20.0

musicId=3
title=あいあいあい
weight=30.0

musicId=4
title=あいあいあいあい
weight=40.0

musicId=1
title=あい
weight=10.0

I expected a doc that has higher boost value will be matched at top but
it does not.
Give me some advice please.

Thanks for reading.

--
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/96e85231-6341-4919-adc8-af0273824777%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
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/CALY%3DcQC1A0M7kS_YLsLYH3_%2B9X477XuHdkODyiP7Y_zsOYXWxw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

You are right. Sort looks like better than custom score when simply
ordering by a field.

2013년 12월 5일 목요일 오전 12시 28분 17초 UTC+9, Ivan Brusic 님의 말:

Why not simply sort on the weight field?

--
Ivan

On Wed, Dec 4, 2013 at 1:44 AM, Min Cha <mins...@gmail.com <javascript:>>wrote:

Redirecting to Google Groups

ES supports custom score script so if I wants to sort only _boost value,
I can use script as "source._boost" in script.
It`s simple and works fine.

Example : {"query":{"custom_score":{"query":{"query_string":{"
query":"title:"Love""}},"script":"_source.boost"}}}

2013년 11월 19일 화요일 오후 4시 9분 54초 UTC+9, Min Cha 님의 말:

Hi all.
I am implementing keyword search function. For this I have declared
mapping as following.

{
"fulltext":{
"_boost":{
"name":"weight",
"null_value":1.0
},
"properties":{
"musicId":{
"type":"integer",
"index":"not_analyzed",
"store":"true"
},
"title":{
"type":"string",
"index":"analyzed",
"store":"true",
"analyzer":"cjk"
},
"weight":{
"type":"double",
"index":"not_analyzed",
"store":"true"
}
}
}
}

Next, I have put as following docs.

musicId(1), title("あい"), weight(10)
musicId(2), title("あいあい"), weight(20)
musicId(3), title("あいあいあい"), weight(30)
musicId(4), title("あいあいあいあい"), weight(40)

When, then, I searched by the keyword 'あい', output was as following.

musicId=2
title=あいあい
weight=20.0

musicId=3
title=あいあいあい
weight=30.0

musicId=4
title=あいあいあいあい
weight=40.0

musicId=1
title=あい
weight=10.0

I expected a doc that has higher boost value will be matched at top but
it does not.
Give me some advice please.

Thanks for reading.

--
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/96e85231-6341-4919-adc8-af0273824777%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
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/d74752f0-81f6-4e2a-9a6d-665d0321cc76%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.