At this point in my app I need to solve scoring implementation task. What I
need to achieve is that - if term is found in *Surname *field, it can get
custom boost that is taken from scoreBoostForSurname otherwise (if term
found in Name then scoreBoostForSurname value is not used)
Lets assume I have simple three documents:
{
"thisID": "1",
"name": "Elastic",
"surname": "Search",
"scoreBoosterForSurname": "0"
}
{
"thisID": "2",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "10"
}
{
"thisID": "3",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "5"
}
And now lets assume I'm querying these documents.
'
{
query: {bool: {must: [{query_string: {
query: "Elastic",
default_operator: "AND",
analyze_wildcard: true,
fields: [
"name",
"surname",
]
}}]}}
}
'
What I prefer is that if ordered by score results are ordered and returned
to me in this order 2,3,1 (values from *thisID *field)
So what I assume I need here is not custom score, but custom field
boosting. Is it really achievable at the moment in Elastic Search? Or is
there something about custom scoring or even Elastics scoring I don't know
yet?
I checked on nested objects, but does help to solve my task as well as
index with child elements as child elements are not included in final
result when querying parent.
The other options I consider is to use custom score with duplicating user
entries (documents) and then removing duplicated results at my application
side.
On Wednesday, October 31, 2012 11:58:56 AM UTC-4, dzintarsrerihs wrote:
Hello!
At this point in my app I need to solve scoring implementation task. What
I need to achieve is that - if term is found in *Surname *field, it can
get custom boost that is taken from scoreBoostForSurname otherwise (if
term found in Name then scoreBoostForSurname value is not used)
Lets assume I have simple three documents:
{
"thisID": "1",
"name": "Elastic",
"surname": "Search",
"scoreBoosterForSurname": "0"
}
{
"thisID": "2",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "10"
}
{
"thisID": "3",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "5"
}
And now lets assume I'm querying these documents.
'
{
query: {bool: {must: [{query_string: {
query: "Elastic",
default_operator: "AND",
analyze_wildcard: true,
fields: [
"name",
"surname",
]
}}]}}
}
'
What I prefer is that if ordered by score results are ordered and returned
to me in this order 2,3,1 (values from *thisID *field)
So what I assume I need here is not custom score, but custom field
boosting. Is it really achievable at the moment in Elastic Search? Or is
there something about custom scoring or even Elastics scoring I don't know
yet?
I checked on nested objects, but does help to solve my task as well as
index with child elements as child elements are not included in final
result when querying parent.
The other options I consider is to use custom score with duplicating user
entries (documents) and then removing duplicated results at my application
side.
On Wednesday, October 31, 2012 11:58:56 AM UTC-4, dzintarsrerihs wrote:
Hello!
At this point in my app I need to solve scoring implementation task. What
I need to achieve is that - if term is found in *Surname *field, it can
get custom boost that is taken from scoreBoostForSurname otherwise (if
term found in Name then scoreBoostForSurname value is not used)
Lets assume I have simple three documents:
{
"thisID": "1",
"name": "Elastic",
"surname": "Search",
"scoreBoosterForSurname": "0"
}
{
"thisID": "2",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "10"
}
{
"thisID": "3",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "5"
}
And now lets assume I'm querying these documents.
'
{
query: {bool: {must: [{query_string: {
query: "Elastic",
default_operator: "AND",
analyze_wildcard: true,
fields: [
"name",
"surname",
]
}}]}}
}
'
What I prefer is that if ordered by score results are ordered and
returned to me in this order 2,3,1 (values from *thisID *field)
So what I assume I need here is not custom score, but custom field
boosting. Is it really achievable at the moment in Elastic Search? Or is
there something about custom scoring or even Elastics scoring I don't know
yet?
I checked on nested objects, but does help to solve my task as well as
index with child elements as child elements are not included in final
result when querying parent.
The other options I consider is to use custom score with duplicating user
entries (documents) and then removing duplicated results at my application
side.
On Wednesday, October 31, 2012 11:58:56 AM UTC-4, dzintarsrerihs wrote:
Hello!
At this point in my app I need to solve scoring implementation task. What
I need to achieve is that - if term is found in *Surname *field, it can
get custom boost that is taken from scoreBoostForSurname otherwise (if
term found in Name then scoreBoostForSurname value is not used)
Lets assume I have simple three documents:
{
"thisID": "1",
"name": "Elastic",
"surname": "Search",
"scoreBoosterForSurname": "0"
}
{
"thisID": "2",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "10"
}
{
"thisID": "3",
"name": "Search",
"surname": "Elastic",
"scoreBoosterForSurname": "5"
}
And now lets assume I'm querying these documents.
'
{
query: {bool: {must: [{query_string: {
query: "Elastic",
default_operator: "AND",
analyze_wildcard: true,
fields: [
"name",
"surname",
]
}}]}}
}
'
What I prefer is that if ordered by score results are ordered and
returned to me in this order 2,3,1 (values from *thisID *field)
So what I assume I need here is not custom score, but custom field
boosting. Is it really achievable at the moment in Elastic Search? Or is
there something about custom scoring or even Elastics scoring I don't know
yet?
I checked on nested objects, but does help to solve my task as well as
index with child elements as child elements are not included in final
result when querying parent.
The other options I consider is to use custom score with duplicating user
entries (documents) and then removing duplicated results at my application
side.
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.