Not getting score

Hi,

   I am searching query with sort field means, i am getting the

result with max score as null. If i didn't specify sort field means, i
am getting max score value....

I have mentioned the queries here...

curl -XGET 'http://localhost:9200/dbtest/data/_search' -d
' { "sort" : [ {"_score" : {"reverse" :false } }
] ,"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

curl -XGET 'http://localhost:9200/dbtest/data/_search' -d
' {"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

Currently i am using ES version 0.14.3...........

You need to add the score as another sorting field, and then you will get the score back.
On Monday, January 31, 2011 at 1:45 PM, Arulkumar wrote:

Hi,

I am searching query with sort field means, i am getting the
result with max score as null. If i didn't specify sort field means, i
am getting max score value....

I have mentioned the queries here...

curl -XGET 'http://localhost:9200/dbtest/data/_search' -d
' { "sort" : [ {"_score" : {"reverse" :false } }
] ,"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

curl -XGET 'http://localhost:9200/dbtest/data/_search' -d
' {"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

Currently i am using ES version 0.14.3...........

I am getting score for both queries, but not getting
"max_score" .......?

On Jan 31, 7:54 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

You need to add the score as another sorting field, and then you will get the score back.

On Monday, January 31, 2011 at 1:45 PM, Arulkumar wrote:

Hi,

I am searching query with sort field means, i am getting the
result with max score as null. If i didn't specify sort field means, i
am getting max score value....

I have mentioned the queries here...

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' { "sort" : [ {"_score" : {"reverse" :false } }
] ,"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' {"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

Currently i am using ES version 0.14.3...........

Yea, in this case, max_score will not be returned. This is done since it incurs a cost when just wanting to sort on other fields, but might be enabled, I need to check... .
On Tuesday, February 1, 2011 at 6:29 AM, Arulkumar wrote:

I am getting score for both queries, but not getting
"max_score" .......?

On Jan 31, 7:54 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

You need to add the score as another sorting field, and then you will get the score back.

On Monday, January 31, 2011 at 1:45 PM, Arulkumar wrote:

Hi,

I am searching query with sort field means, i am getting the
result with max score as null. If i didn't specify sort field means, i
am getting max score value....

I have mentioned the queries here...

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' { "sort" : [ {"_score" : {"reverse" :false } }
] ,"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' {"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

Currently i am using ES version 0.14.3...........

Ok, was not too difficult to enable: Search: When sorting, allow to pass `track_scores` and set it to `true` to get scores/max_score back · Issue #662 · elastic/elasticsearch · GitHub
On Tuesday, February 1, 2011 at 11:49 AM, Shay Banon wrote:

Yea, in this case, max_score will not be returned. This is done since it incurs a cost when just wanting to sort on other fields, but might be enabled, I need to check... .
On Tuesday, February 1, 2011 at 6:29 AM, Arulkumar wrote:

I am getting score for both queries, but not getting
"max_score" .......?

On Jan 31, 7:54 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

You need to add the score as another sorting field, and then you will get the score back.

On Monday, January 31, 2011 at 1:45 PM, Arulkumar wrote:

Hi,

I am searching query with sort field means, i am getting the
result with max score as null. If i didn't specify sort field means, i
am getting max score value....

I have mentioned the queries here...

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' { "sort" : [ {"_score" : {"reverse" :false } }
] ,"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' {"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

Currently i am using ES version 0.14.3...........

Ok thank you..

On Feb 1, 3:41 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

Ok, was not too difficult to enable:Search: When sorting, allow to pass `track_scores` and set it to `true` to get scores/max_score back · Issue #662 · elastic/elasticsearch · GitHub

On Tuesday, February 1, 2011 at 11:49 AM, Shay Banon wrote:

Yea, in this case, max_score will not be returned. This is done since it incurs a cost when just wanting to sort on other fields, but might be enabled, I need to check... .
On Tuesday, February 1, 2011 at 6:29 AM, Arulkumar wrote:

I am getting score for both queries, but not getting
"max_score" .......?

On Jan 31, 7:54 pm, Shay Banon shay.ba...@elasticsearch.com wrote:

You need to add the score as another sorting field, and then you will get the score back.

On Monday, January 31, 2011 at 1:45 PM, Arulkumar wrote:

Hi,

I am searching query with sort field means, i am getting the
result with max score as null. If i didn't specify sort field means, i
am getting max score value....

I have mentioned the queries here...

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' { "sort" : [ {"_score" : {"reverse" :false } }
] ,"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

curl -XGET 'http://localhost:9200/dbtest/data/_search'-d
' {"query" : { "bool" : { "should" : [{ "prefix" : { "field1":
"print" } } ] } }, "from" : 0, "size" : 20, "explain"
: false,"fields":["field1","field2"] }'

Currently i am using ES version 0.14.3...........