Why i am not getting any score in SearchRequestBuilder after sorting?

Hello everyone,

I just got my hands on elasticsearch yesterday, because we had a requirement of evaluating complex mathematical queries for comparison like "evaluating eculadian distances" rather than simple text matching.
I read that in elasticsearch, we can execute scripts as well as native (java) scripts for evaluating custom scores.

So my first question was 1. what is the score exactly? and how is it evaluated?
2. when i am using SearchRequestBuilder (in JAVA API) and sorting, and then taking out score it gives NaN wheres it gives type/index.
3. and also could anyone point me in right direction of "how to evaluate custom scores depending on the values in the file". Ok exactly what i am doing is i am hashing images into feature vectors which are stored in a file. Now to compare two feature vectors i have to calculate a distance between them, so this distance which gives similarity factor should decide the score (from what i get score is). so how to do it? i heard that we could use native scripts for that, but couldn't get it exactly.

Thanking everyone in advance.

On Sun, Mar 18, 2012 at 5:15 PM, rohitkondekar rohitkondekar@gmail.comwrote:

Hello everyone,

I just got my hands on elasticsearch yesterday, because we had a
requirement
of evaluating complex mathematical queries for comparison like "evaluating
eculadian distances" rather than simple text matching.
I read that in elasticsearch, we can execute scripts as well as native
(java) scripts for evaluating custom scores.

So my first question was 1. what is the score exactly? and how is it
evaluated?

Here is a quick page that explains it:
http://lucene.apache.org/core/old_versioned_docs/versions/3_0_0/scoring.html
.

  1. when i am using SearchRequestBuilder (in JAVA API) and sorting, and then
    taking out score it gives NaN wheres it gives type/index.

Yes, when doing sorting, then by default score will not be returned. You
can call SearchRequestBuilder#setTrackScores(true) to also get scores back
when sorting.

  1. and also could anyone point me in right direction of "how to evaluate
    custom scores depending on the values in the file". Ok exactly what i am
    doing is i am hashing images into feature vectors which are stored in a
    file. Now to compare two feature vectors i have to calculate a distance
    between them, so this distance which gives similarity factor should decide
    the score (from what i get score is). so how to do it? i heard that we
    could
    use native scripts for that, but couldn't get it exactly.

I am not too familiar with it. You could potentially index it in
elasticsearch / Lucene, and use the raw values using a script (getting the
values for each one). I saw a project once that indexed images into Lucene,
using Lucene features to index the data, maybe google for it?

Thanking everyone in advance.

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Why-i-am-not-getting-any-score-in-SearchRequestBuilder-after-sorting-tp3836699p3836699.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.