Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am new to ElasticSearch & was trying to execute the example mentioned in their home page where I came across this erorr -
"error": {
"root_cause": [
"type": "illegal_argument_exception",
"reason": "unknown setting [index.mappings.employee.properties.age.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
"type": "illegal_argument_exception",
"reason": "unknown setting [index.mappings.employee.properties.age.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
"suppressed": [
"type": "illegal_argument_exception",
"reason": "unknown setting [index.mappings.employee.properties.experience.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
"type": "illegal_argument_exception",
"reason": "unknown setting [index.mappings.employee.properties.name.analyzer] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
"type": "illegal_argument_exception",
"reason": "unknown setting [index.mappings.employee.properties.name.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
"status": 400
The url & body of the post request are as follows -
URL - >
http://localhost:9200/company
BODY - >
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
"analysis": {
"analyzer": {
"analyzer-name": {
"type": "custom",
"tokenizer": "keyword",
"filter": "lowercase"
"mappings": {
"employee": {
"properties": {
"age": {
"type": "long"
"experience": {
"type": "long"
"name": {
"type": "string",
"analyzer": "analyzer-name"
How to fix the error ?
There are two errors in syntax of your JSON body object:
Node
settings
must have only two childs:
index
and
analysis
. Node
mappings
must be root-level.
Field
name
has invalid type
string
, it must be
text
or
keyword
. Because you need this field to be analyzed, it should be
text
in your case.
So working query
for ES version 6.x
(that was current at the time of the question) should be like this:
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
"analysis": {
"analyzer": {
"analyzer-name": {
"type": "custom",
"tokenizer": "keyword",
"filter": "lowercase"
"mappings": {
"employee": {
"properties": {
"age": {
"type": "long"
"experience": {
"type": "long"
"name": {
"type": "text",
"analyzer": "analyzer-name"
Starting from ES version 7.0, mapping types
was removed
from index definition, so the query above wouldn't work in ES 7.x.
Working query
for ES version 7.x
could be two types:
If index should contain data only about employees, you can simply delete
employee
mapping type and query would be like this:
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
"analysis": {
"analyzer": {
"analyzer-name": {
"type": "custom",
"tokenizer": "keyword",
"filter": "lowercase"
"mappings": {
"properties": {
"age": {
"type": "long"
"experience": {
"type": "long"
"name": {
"type": "text",
"analyzer": "analyzer-name"
If index should contain data about employees and some other data, you can use
employee
as field of the
object type
and query would be like this:
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
"analysis": {
"analyzer": {
"analyzer-name": {
"type": "custom",
"tokenizer": "keyword",
"filter": "lowercase"
"mappings": {
"properties": {
"employee": {
"properties": {
"age": {
"type": "long"
"experience": {
"type": "long"
"name": {
"type": "text",
"analyzer": "analyzer-name"
–
–
As you mentioned that you are new to Elastic Search, better start with the basic and use the default settings of ElasticSearch. Use the following mapping:
curl -XPUT localhost:9200/company -d '{
"mappings": {
"employee": {
"properties": {
"age": {"type": "long"},
"experience": {"type": "long"},
"name": {"type": "string","index": "not_analyzed"}
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.