Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Failed to parse mapping [_doc]: No handler for type [flattened] declared on field #3733

Closed
mirisu2 opened this issue Jun 28, 2022 · 3 comments
Labels
bug Something isn't working Indexing & Search

Comments

@mirisu2
Copy link

mirisu2 commented Jun 28, 2022

Hi,
I would like to use type flattened to prevent mapping explosion like this example. I got an error while creating _index_template

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "composable template [fluentbit-dev] template after composition is invalid"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "composable template [fluentbit-dev] template after composition is invalid",
    "caused_by" : {
      "type" : "illegal_argument_exception",
      "reason" : "invalid composite mappings for [fluentbit-dev]",
      "caused_by" : {
        "type" : "mapper_parsing_exception",
        "reason" : "Failed to parse mapping [_doc]: No handler for type [flattened] declared on field [log_processed.data.Body]",
        "caused_by" : {
          "type" : "mapper_parsing_exception",
          "reason" : "No handler for type [flattened] declared on field [log_processed.data.Body]"
        }
      }
    }
  },
  "status" : 400
}

To Reproduce

PUT _index_template/fluentbit-dev
{
	"index_patterns" : [
	  "fluentbit-dev-*"
	],
	"template" : {
	  "settings" : {
		"index" : {
		  "number_of_shards" : "1",
		  "number_of_replicas" : "0",
		  "mapping": {
		    "total_fields": {
		      "limit": 100
		    }
		  }
		}
	  },
	  "mappings" : {
  		"_source" : {
  		  "enabled" : true
  		},
  		"properties" : {
  		  "log_processed.data.Body": {
  		    "type": "flattened"
  		  }
  		}
	  }
	},
	"composed_of" : [ ]
}

Expected behavior
I expect to create _index_template with "type": "flattened" configuration.

Plugins
opensearch-alerting
opensearch-anomaly-detection
opensearch-asynchronous-search
opensearch-cross-cluster-replication
opensearch-index-management
opensearch-job-scheduler
opensearch-knn
opensearch-ml
opensearch-observability
opensearch-performance-analyzer
opensearch-reports-scheduler
opensearch-security
opensearch-sql

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):
Opensearch: 1.3.3
OS: CentOS 7.9

Is it possible to use such configuraton while creating _index_template ? Or I can use only this types?
Is it possible at all to prevent to index part of fields?

@mirisu2 mirisu2 added bug Something isn't working untriaged labels Jun 28, 2022
@reta
Copy link
Collaborator

reta commented Jun 29, 2022

@mirisu2 flattened is Elasticsearch X-Pack feature, not supported by OpenSearch, see please [1]

[1] #1018

@mirisu2
Copy link
Author

mirisu2 commented Jun 29, 2022

Does anyone know, is it possible to prevent to index part of fields?
image
If I got it right, by the documentation, if i define something in dynamic_templates block, it doesn't override fields I defined in the properties block. But this _index_template doesn't work properly :( The fields in path log_processed.data.* doesn't index

@mirisu2
Copy link
Author

mirisu2 commented Jun 29, 2022

FYI
this _index_template work properly, but many fields should not be indexed, and I can't define every of them.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing & Search
Projects
None yet
Development

No branches or pull requests

3 participants