Scoring based off pre-computed scores (function score query + nesting)


(Ben McCann) #1

I'm wondering how I might be able to utilize pre-computed scores. E.g.
let's say that we're searching for a college to go to and have computed
scores for some number of attributes. Is there some way I could do custom
scoring utilizing my precomputed values? The part where I'm getting stuck
is combining function score queryhttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.htmlwith a nested
mappinghttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html
.

Any tips?

{
attributes: [
{ term: "computer science" , score: 95 },
{ term: "biology" , score: 67 },
{ term: "mathematics" , score: 50 },
{ term: "english" , score: 34 },
{ term: "football" , score: 69 },
{ term: "parties" , score: 74 },
{ term: "graduate pay" , score: 82 },
]
}

Thanks,
Ben

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


(Alexander Reelsen) #2

Hey,

if you take your time to create a gist, which other people can easily run
locally, the likelihood of getting help is much higher. Also please not
what you expect and what is not being returned in your queries.

Thanks!

--Alex

On Wed, Nov 6, 2013 at 5:11 AM, Ben McCann benjamin.j.mccann@gmail.comwrote:

I'm wondering how I might be able to utilize pre-computed scores. E.g.
let's say that we're searching for a college to go to and have computed
scores for some number of attributes. Is there some way I could do custom
scoring utilizing my precomputed values? The part where I'm getting stuck
is combining function score queryhttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.htmlwith a nested
mappinghttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html
.

Any tips?

{
attributes: [
{ term: "computer science" , score: 95 },
{ term: "biology" , score: 67 },
{ term: "mathematics" , score: 50 },
{ term: "english" , score: 34 },
{ term: "football" , score: 69 },
{ term: "parties" , score: 74 },
{ term: "graduate pay" , score: 82 },
]
}

Thanks,
Ben

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


(Hasham Ahmad) #3

As I understand it nested objects can't be referenced this way because of
some internal structural behaviour and I was advised to use an array with
string concatenation ['computer science:95',...] - this then relates to my
recent question at
https://groups.google.com/forum/#!topic/elasticsearch/wq0t2sxBqUA

Hash

On Wednesday, 6 November 2013 05:11:11 UTC+1, Ben McCann wrote:

I'm wondering how I might be able to utilize pre-computed scores. E.g.
let's say that we're searching for a college to go to and have computed
scores for some number of attributes. Is there some way I could do custom
scoring utilizing my precomputed values? The part where I'm getting stuck
is combining function score queryhttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.htmlwith a nested
mappinghttp://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html
.

Any tips?

{
attributes: [
{ term: "computer science" , score: 95 },
{ term: "biology" , score: 67 },
{ term: "mathematics" , score: 50 },
{ term: "english" , score: 34 },
{ term: "football" , score: 69 },
{ term: "parties" , score: 74 },
{ term: "graduate pay" , score: 82 },
]
}

Thanks,
Ben

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


(system) #4