Dynamic mapping and fields with underscores


(sgt_b2002) #1

I have an index template with a few static field mappings and a dynamic_template section that maps all other fields as string/not_analyzed. This works well and fields are mapped properly. That is, it was working well until fields with underscores were introduced into the mix.

The following field names are not assigned string/not_analyzed, but instead Elasticsearch attempts to identify their type which, in this case, is not desirable. It doesn't seem to affect all fields with underscores, but ones whose values are numbers. What is the root cause of this? I've tried changing the underscores to dashes as well to the same effect.

Examples
docs_0_process_pid
docs_0_parent_pid

I can certainly add static mappings for the "problem" fields, but I'd like to understand the issue I'm experiencing.

ES 1.4.4 (upgrade is scheduled)

Here's relevant portion of the template I'm using. Thanks!

{
	"template": "prod-index*",
	"mappings": 
	{
		"type-mytype": 
		{
			"dynamic_templates": 
			[
				{
					"default_strings": 
					{
						"match": "*",
						"match_mapping_type": "string",
						"mapping": 
						{
							"type": "string",
							"index": "not_analyzed",
							"doc_values": true
						}
					}
				}
			],

			"properties": 
			{
				"FieldA": 
				{
					"type": "string",
				},
				"FieldB": 
				{
					"type": "integer",
				},

(system) #2