Thanks Clinton. Can you help me through this error?
Here is a couple of documents that return on a regular script score.
"hits": {
"total": 246,
"max_score": 1.293869,
"hits": [
{
"_index": "intent",
"_type": "intent",
"_score": 1.293869,
"_source": {
"alias": "RAS",
"rootTerm": "RAS"
}
},
{
"_index": "intent",
"_type": "intent",
"_score": 0.9466758,
"_source": {
"rootTerm": "3-Methyl-Aspartic Acid",
"alias": "3MA"
}
...]
Then when I add script score, only the first hit should still have a score:
"script_score": {
"script": "log(_score * ((doc['alias'].value ==
doc['rootTerm'].value) ? : 1 : 0))"
}
But I get this error..
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures {[Cq92Pqk5QYayO_4af76HjA][intent][0]:
QueryPhaseExecutionException[[intent][0]: query[function score (term:ras~2,
functions: [{filter(:), function [script[log(_score *
((doc['alias'].value == doc['rootTerm'].value) ? : 1 : 0))], params
[null]]}])],from[0],size[10]: Query Failed [Failed to execute main query]];
nested: CompileException[[Error: illegal use of operator:
TERNARY_ELSE]\n[Near : {... ((doc['alias'].value == doc['rootTerm'].value)
? : 1 : 0)) ....}]\n
^\n[Line: 1, Column: 63]]; }{[Cq92Pqk5QYayO_4af76HjA][intent][1]:
QueryPhaseExecutionException[[intent][1]: query[function score (term:ras~2,
functions: [{filter(:), function [script[log(_score *
((doc['alias'].value == doc['rootTerm'].value) ? : 1 : 0))], params
[null]]}])],from[0],size[10]: Query Failed [Failed to execute main query]];
nested: CompileException[[Error: illegal use of operator:
TERNARY_ELSE]\n[Near : {... ((doc['alias'].value == doc['rootTerm'].value)
? : 1 : 0)) ....}]\n
^\n[Line: 1, Column: 63]]; }{[Cq92Pqk5QYayO_4af76HjA][intent][2]:
QueryPhaseExecutionException[[intent][2]: query[function score (term:ras~2,
functions: [{filter(:), function [script[log(_score *
((doc['alias'].value == doc['rootTerm'].value) ? : 1 : 0))], params
[null]]}])],from[0],size[10]: Query Failed [Failed to execute main query]];
nested: CompileException[[Error: illegal use of operator:
TERNARY_ELSE]\n[Near : {... ((doc['alias'].value == doc['rootTerm'].value)
? : 1 : 0)) ....}]\n
^\n[Line: 1, Column: 63]]; }{[Cq92Pqk5QYayO_4af76HjA][intent][3]:
QueryPhaseExecutionException[[intent][3]: query[function score (term:ras~2,
functions: [{filter(:), function [script[log(_score *
((doc['alias'].value == doc['rootTerm'].value) ? : 1 : 0))], params
[null]]}])],from[0],size[10]: Query Failed [Failed to execute main query]];
nested: CompileException[[Error: illegal use of operator:
TERNARY_ELSE]\n[Near : {... ((doc['alias'].value == doc['rootTerm'].value)
? : 1 : 0)) ....}]\n
^\n[Line: 1, Column: 63]]; }{[Cq92Pqk5QYayO_4af76HjA][intent][4]:
QueryPhaseExecutionException[[intent][4]: query[function score (term:ras~2,
functions: [{filter(:), function [script[log(_score *
((doc['alias'].value == doc['rootTerm'].value) ? : 1 : 0))], params
[null]]}])],from[0],size[10]: Query Failed [Failed to execute main query]];
nested: CompileException[[Error: illegal use of operator:
TERNARY_ELSE]\n[Near : {... ((doc['alias'].value == doc['rootTerm'].value)
? : 1 : 0)) ....}]\n
^\n[Line: 1, Column: 63]]; }]",
"status": 500
}
--
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/06ace2ef-0759-478a-99ab-a5232493efba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.