(Spark) Top K results in esRDD (beginner question)

(tal) #1

I just started using ES and spark, and i'm trying to get only the k best
results by score, for a really simple query on simple documents (just id
and content text)
How can i populate the RDD with only the top K results for that query? (i
tried using the size option but since it's just page size and it seems that
the rdd creation runs over all pages i still get all the results)

it would be great if anyone can point me in the right direction,
is it top_hits ? (even though i don't need any bucketing or anything like


Please update your bookmarks! We have moved to https://discuss.elastic.co/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d0a65329-cb76-4a09-b9bd-4864ca9bc8ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

(system) #2