partial fields in elasticsearch2.2.0 is not working? - elasticsearch

May i know the details why the partial fields is not working in elasticsearch 2.2.0.I recently upgraded from elasticsearch 1.7.2 to elasticsearch 2.2.0.In older version it is working but after upgration results are not coming and raising an exception.
Pls find error for your reference
{
"error": {
"root_cause": [
{
"type": "search_parse_exception",
"reason": "failed to parse search source. unknown search element [partial_fields]",
"line": 79,
"col": 4
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "candidates1",
"node": "tlFrZ6JKTOWJ6krrkRnhMw",
"reason": {
"type": "search_parse_exception",
"reason": "failed to parse search source. unknown search element [partial_fields]",
"line": 79,
"col": 4
}
}
]
},
"status": 400
}

Partial fields have been removed in 2.0 and now you should use source filtering instead.
Simply replace partial_fields with _source and it should work.

Related

mapper_parsing_exception while import dashboard to kibana

When I import a dashboard from kibana 7.5.1 to kibana 7.4.1, it failed with error "the file could not be processed". I call kibana import object api on kibana dev tool console instead, and it provide following response:
POST /api/saved_objects/_import
{
"file" : "C:\Users\dashboards-kibana\EKC-Dashboard-Prod.ndjson"
}
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "json_parse_exception",
"reason": "Unrecognized character escape 'U' (code 85)\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper#33da7471; line: 2, column: 17]"
}
},
"status": 400
}
This is my first time work with kibana. Is there anyway to solve the import error?

"Unknown BaseAggregationBuilder [significant_text]" in Elastic search 5.3.2 version

to achieve aggregation for text field i tried giving
"aggs": {
"keywords": {
"significant_text": {
"field": "testId",
"min_doc_count":1
}
}
}
this works fine in elk 6.6.1 version. but in ELK 5.3.1 version it throws an error
{
"error": {
"root_cause": [
{
"type": "unknown_named_object_exception",
"reason": "Unknown BaseAggregationBuilder [significant_text]",
"line": 107,
"col": 27
}
],
"type": "unknown_named_object_exception",
"reason": "Unknown BaseAggregationBuilder [significant_text]",
"line": 107,
"col": 27`enter code here`
},
"status": 400
}
can anyone please help me in sorting this out ?
Significant text aggregation was introduced in the 6.0 elasticsearch version, due to this for ELK version 5.3.1, you are getting the below error
"Unknown BaseAggregationBuilder [significant_text]",

Elastic Search Azure Plugin Issue

The elastic search azure plugin troubleshooting issue:
I am trying to snapshot the index data from on prem to azure and am getting the same exception:
{
"error": {
"root_cause": [
{
"type": "repository_verification_exception",
"reason": "[qarepository] path is not accessible on master node"
}
],
"type": "repository_verification_exception",
"reason": "[qarepository] path is not accessible on master node",
"caused_by": {
"type": "i_o_exception",
"reason": "Can not write blob master.dat",
"caused_by": {
"type": "storage_exception",
"reason": "storage_exception: ",
"caused_by": {
"type": "i_o_exception",
"reason": "qaonpremesindex.blob.core.windows.net"
}
}
}
},
"status": 500
}
steps followed:
Created storage account in azure
Created a blob container
added the keystore values(name&key)
PUT _snapshot/qarepository
{
"type": "azure"
}

Elasticsearch reply for expired scroll context

When using the Elasticsearch scroll API to receive query results that have many matches you must provide a scroll time-out amount. Elasticsearch does not guarantee keeping the scroll context alive beyond that time-out (scrolls are processed as a kind of "session" that Elasticsearch remembers).
But what happens if you ask Elasticsearch for another "page" after that time-out expires? What response do you get from Elasticsearch? Does it have a distinctive HTTP status code? Or distinctive fields in a JSON response body?
The response status code is 404. You also get an error message explaining what happened.
{
"error": {
"caused_by": {
"reason": "No search context found for id [35544152]",
"type": "search_context_missing_exception"
},
"failed_shards": [
{
"index": null,
"reason": {
"reason": "No search context found for id [35544152]",
"type": "search_context_missing_exception"
},
"shard": -1
}
],
"grouped": true,
"phase": "query",
"reason": "all shards failed",
"root_cause": [
{
"reason": "No search context found for id [35544152]",
"type": "search_context_missing_exception"
}
],
"type": "search_phase_execution_exception"
},
"status": 404
}

How to handle empty field names in ElasticSearch?

I'd like to log users' input to my RESTful API for debugging purpose but whenever there's an empty field in the JSON payload, an error is generated and the log is discarded.
For instance,
{
"extra": {
"request": {
"body": {
"": ""
}
}
}
}
...will result in
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "failed to parse"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "field name cannot be an empty string"
}
},
"status": 400
}
It seems to be caused by https://github.com/elastic/elasticsearch/blob/45e7e24736eeb4a157ac89bd16a374dbf917ae26/server/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java#L191.
It's a bit tricky since it happens in the parsing phase... Is there any workaround to remove/rename such fields so that it can enable ES to digest these logs?

Resources