ropensci / elastic

R client for the Elasticsearch HTTP API
https://docs.ropensci.org/elastic
Other
244 stars 58 forks source link

More-like-this query always returns zero scores #126

Closed jenkin closed 8 years ago

jenkin commented 8 years ago

Hi, I'm using scan and scroll api (ie. last example here) to fetch all documents similar to others (see mlt query). All works fine, but scoring for all returned documents is always zero. If I directly run the same query (ie. in Sense), the result is the same, but with correct scores. Is there a problem during conversion from json to R data structures? Thanks! :)

sckott commented 8 years ago

thanks for the report @jenkin - I'll have a look now

sckott commented 8 years ago

I believe scores are not tracked when scrolling (See http://mail-archives.us.apache.org/mod_mbox/spark-user/201504.mbox/%3C1429349001763.b5aa674f@Nodemailer%3E), so all are reported as zero

If I directly run the same query (ie. in Sense), the result is the same, but with correct scores

but are you scrolling in the Sense GUI?

jenkin commented 8 years ago

D'oh! Thank you, I missed this detail in scan&scroll feature of ES... just now I'm trying with python library and score is always zero. And no, in Sense I performed simple query, without scrolling. Ok, nevermind, I'll use simple pagination to retrieve first N results, sorry for this "not-so" issue... :)

sckott commented 8 years ago

No problem. I had forgotten about scores for scroll, I'll add a note to the docs if not already there