Custom analyzer defined in one template, but not found when referenced in another

In my first attempt at using templates, I'm trying to define a bunch of stuff in a global template, including my custom analyzers, that will then be referenced in other templates. But I'm running into an error when I try to add a template that references an analyzer that's defined in my global template. I get the error:

Error Type: [mapper_parsing_exception], Error Reason: [Failed to parse mapping [companies]: analyzer [tight] not found for field [name]]

Is it possible to reference a custom analyzer defined in a different template, or do I need to replicate the analyzer definitions in each template?

Here's how I define my global template, which I am able to add to the cluster:

{
	"template": "*",
	"order": 0,
	"version": 1,
	"settings": {
		"number_of_shards" : 1,
		"analysis": {
			"analyzer": {
				"tight": { ... }
			}
		}
	}
}

And then here's the next template that I try to define (which generates the error)

{
	"template": "companies",
	"order": 1,
	"version": 1,
	"mappings": {
		"companies": {
			"properties": {
				"name": {"type": "text", "analyzer": "tight"}
			}
		}
	}
}

It's the latter.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.