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"
}}
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query],
total failure; shardFailures {[LS6ki3GCS_yyziipuYI9Og][vitrina][3]:
RemoteTransportException[[Arlok][inet[/10.10.205.24:9300]][search/phase/query]];
nested: SearchParseException[[vitrina][3]: from[-1],size[-1]: Parse Failure
[Failed to parse source
[{"custom_score":{{"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10},"script":"_score"
}}]]]; nested: SearchParseException[[vitrina][3]: from[-1],size[-1]: Parse
Failure [No parser for element [custom_score]]];
}{[Cq6VIo58SQCCjpMay6KrhQ][vitrina][0]: SearchParseException[[vitrina][0]:
from[-1],size[-1]: Parse Failure [Failed to parse source
[{"custom_score":{{"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10},"script":"_score"
}}]]]; nested: SearchParseException[[vitrina][0]: from[-1],size[-1]: Parse
Failure [No parser for element [custom_score]]];
}{[Cq6VIo58SQCCjpMay6KrhQ][vitrina][1]: SearchParseException[[vitrina][1]:
from[-1],size[-1]: Parse Failure [Failed to parse source
[{"custom_score":{{"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10},"script":"_score"
}}]]]; nested: SearchParseException[[vitrina][1]: from[-1],size[-1]: Parse
Failure [No parser for element [custom_score]]];
}{[qqcovTfeRg2mk72Yjf0OIA][vitrina][2]: RemoteTransportException[[Devil
Dinosaur][inet[/10.10.205.25:9300]][search/phase/query]]; nested:
SearchParseException[[vitrina][2]: from[-1],size[-1]: Parse Failure [Failed
to parse source
[{"custom_score":{{"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10},"script":"_score"
}}]]]; nested: SearchParseException[[vitrina][2]: from[-1],size[-1]: Parse
Failure [No parser for element [custom_score]]];
}{[LS6ki3GCS_yyziipuYI9Og][vitrina][4]:
RemoteTransportException[[Arlok][inet[/10.10.205.24:9300]][search/phase/query]];
nested: SearchParseException[[vitrina][4]: from[-1],size[-1]: Parse Failure
[Failed to parse source
[{"custom_score":{{"query":{"query_string":{"default_field":"_all",
"default_operator":"AND","query":"майка~0.7"}},"size":10},"script":"_score"
}}]]]; nested: SearchParseException[[vitrina][4]: from[-1],size[-1]: Parse
Failure [No parser for element [custom_score]]]; }]",
"status": 500
}
On Mon, Nov 7, 2011 at 7:44 PM, Karussell tableyourtime@googlemail.comwrote:
Try a custom score function with a random seed returned
Peter.
On Nov 7, 2:12 pm, Андрей Смолев andrey.smo...@gmail.com wrote:
Hello!
Is it possible to set up sorting to return items at random based on one
of
the field?
Something like :
{
"sort" : {
{ "post_date" : {"order" : "RANDOM"} },
"user" : { },
"_score" : { }
},
"query" : {
"term" : { "user" : "kimchy" }
}
}
Or any other possibilities to get a random responce.
Thanks,
Andrey.