Hi! Guys!
Im novice in elesticsearch.. Now I have this request:
{"size":100,"from":0,
"query":{
"filtered":{
"filter":{
"and":[
{"exists" : {"field" : "psp_name" }}
]
}
}
},
"facets":{
"txtamountusdtransaction_sum":{
"facet_filter":{
"exists" : {"field" : "psp_name" }
},
"terms_stats":{
"key_field":"psp_name",
"value_field":"txt_amount_usd_transaction"
}
}
}
}
My mission make work facets. But I always get error about "failed to find
mapping for psp_name]"
{"error":"SearchPhaseExecutionException[Failed to execute phase [query],
all shards failed; shardFailures
{[DOGYFjtdS26ba9lKa44-BA][.marvel-2014.04.12][0]:
SearchParseException[[.marvel-2014.04.12][0]:
query[ConstantScore(+cache(BooleanFilter(psp_name:[* TO
*])))],from[0],size[100]: Parse Failure [Failed to parse source
[{"size":100,"from":0,\n\t"query":{\n \t"filtered":{\n
\t\t"filter":{\n \t\t"and":[\n \t\t\t{"exists" : {"field" :
"psp_name" }}\n \t]\n \t\t}\n }\n },\n "facets":{\n
\t"txtamountusdtransaction_sum":{\n \t"facet_filter":{\n \t\t"exists"
: {"field" : "psp_name" }\n \t},\n \t"terms_stats":{\n
\t"key_field":"psp_name",\n
"value_field":"txt_amount_usd_transaction"\n }\n }\n }\n}]]]; nested:
FacetPhaseExecutionException[Facet [txtamountusdtransaction_sum]: failed to
find mapping for psp_name]; }
For exaple, if my request looks like this:
My response containg nice data, and field "psp_name" for each
"hits" contains anything!
{
"took": 13788,
"timed_out": false,
"_shards": {
"total": 126,
"successful": 126,
"failed": 0
},
"hits": {
"total": 2264,
"max_score": 1,
"hits": [
{
"_index": "logstash-2014.04.17",
"_type": "app",
"_id": "JxxxnDjdTMe0MLM34VyOrw",
"_score": 1,
"_source": {
"@fields": {
"environment": "production",
"project": "",
"psp_status": "success",
"psp_name": "asd",
"mobile_app": "false",
"txt_amount_transaction": "30.0 USD",
"txt_amount_usd_transacrion": 30,
"txt_amount_user_transaction": "30.0 USD",
"txt_response_from_server":
"",
"level": "DEPOSIT",
"txt_account_number": ,
"txt_origin_id": 24,
"txt_request_to_server": ""
},
"@source_path": "/var/www/",
"@source_host": "*******************",
"@type": "app",
"@source": "***",
"message": "",
"type": "app",
"@tags": [],
"@timestamp": "2014-04-17T01:22:14.837+01:00",
"@version": "1"
}
},
................................,
.................................,
But if I try get all data:
{"size":100,"from":0,
"query":{
"match_all" : {}
}
}
I have:
"hits": {
"total": 45848,
"max_score": 1,
"hits": [
{
"_index": "logstash-2014.04.17",
"_type": "app",
"_id": "SF32k0WtQz6yRFiGgDWq9w",
"_score": 1,
"_source": {
"@source": "",
"@type": "app",
"@tags": [],
"@fields": {
"level": "ERROR",
"class": "NoMethodError",
"txt_backtrace": "***********",
"betrails_host": "",
"betrails_http_host": "",
"txt_uri": "********************",
"txt_params": "",
"txt_session": "*",
"user_id": "",
"txt_referer": null,
"environment": "production",
"project": "*****rails"
},
"message": "undefined method `tag' for nil:NilClass",
"type": "app",
"@source_host": ".int",
"@source_path": "/var/www/www..com",
"@timestamp": "2014-04-17T01:00:39.591+01:00",
"@version": "1"
}
},
As you can see, psp_name not present in last response...
Maybe the problem is that some records not have psp_name field ? Why my "facet_filter"
in first request does not work ?
--
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/caae3be9-b55c-417c-81e6-312ce5c64ab4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.