I'm trying to do something like this with a match all query...I want a
random sampling of my entire record set. Using this custom score
script approach to return a subset of 100,000 random records yields a
very slow query (minutes) against the data set (~100 million records
total). So it must be scanning through all the records before
returning the random results... Does anyone know a more efficient way
to accomplish this? Thanks.
On Nov 9, 6:17 am, Андрей Смолев andrey.smo...@gmail.com wrote:
Ohh, i see!
Here is a working example if anyone is interested:
source={"query":{"custom_score":{"script":"random()*20","query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10}},"sort":{"_score":{"order":"desc"}}}On Wed, Nov 9, 2011 at 3:01 PM, Clinton Gormley cl...@traveljury.comwrote:
On Wed, 2011-11-09 at 14:56 +0400, Андрей Смолев wrote:
I tried to use custom_score but i had an syntax error. What do i do
wrong?_search?source={"custom_score":{{"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10},"script":"_score"
}}the 'custom_score' should be wrapped by an outer {query: {...}}
clint