I'm having trouble with custom score. I'm not sure what is causing this
type of error. Could be something with mapping?
I'm sure that nesting is fine at this point. Trouble is somehow related
with doc['price'].value
and I get this error:
{
"error" : "SearchPhaseExecutionException[Failed to execute phase
[query_fetch], total failure; shardFailures
{[1MKcC6LWTfCrbMF-jdUq3Q][cc_7][0]: QueryPhaseExecutionException[[cc_7][0]:
query[filtered(custom score ((prior_keywords.lv:bilb*^5.0 |
keywords.lv:bilb*^4.0),function=script[_score + doc[price].value], params
[null]))->cache(_type:page)],from[0],size[10]: Query Failed [Failed to
execute main query]]; nested: CompileException[[Error: No field found for
[org.elasticsearch.index.field.data.ints.IntDocFieldData@32e9c040] in
mapping with types [page]]\n[Near : {... _score + doc[price].value ....}]\n
^\n[Line: 1, Column: 1]]; nested: ElasticSearchIllegalArgumentException[No
field found for
[org.elasticsearch.index.field.data.ints.IntDocFieldData@32e9c040] in
mapping with types [page]]; }]",
"status" : 500
}
Thank you for your assistance. Didn't notice that, but yes, this solves the
problem and everything else with scoring calculatio works fine now.
Have a good friday!
Dzintars
piektdiena, 2012. gada 19. oktobris 14:32:00 UTC+3, Clinton Gormley
rakstīja:
On Fri, 2012-10-19 at 03:59 -0700, dzintarsrerihs wrote:
Here is simplified version:
OK - took me a while to find it. Your mapping is fine. Your curl
statement isn't. To highlight the relevant bits:
Hi I face same error
"reason": {
"type": "groovy_script_execution_exception",
"reason": "failed to run inline script [(doc['type'].value == 'CZ' ? 'Allowed' : 'Blocked')] using lang [groovy]",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "No field found for [Rtype] in mapping with types []"
}
Tried to implement ternary operator. Can you guide me with this?
Code snippet:
GET /trans/_search
{
"query": {
"match_all": {}
},
"script_fields": {
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.