ActionRequestValidationException when attempting to set mapping

I am attempting to define a mapping. I am first creating a new index by
adding a document that doesn't contain anything specified in my
mapping/schema. I am using a bulk operation to set the mapping but I get
an ActionRequestValidationException error each time. Here is my JS code:

var mappings = {
"body": [
{ "mappings": {
"component": {
"properties": {
"classifications": {
"type": "string",
"index": "not_analyzed"
}
}
}
}}
]
};
client.bulk(mappings, function(err, resp){
// error appears here
});

The exact message I get is: ActionRequestValidationException[Validation Failed: 1: no requests added;]

Any help would sure be appreciated.

Blake McBride

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7e4580c1-708e-4cf8-a39e-a8bcc314d65b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi Blake,

I'm not an expert in the JS client, but the bulk requests are meant for
indexing data. If you want to set the mapping you can do it in index
creation time or by using the dedicate put mapping API
( Update mapping API | Elasticsearch Guide [8.11] | Elastic
).

Cheers,
Boaz

On Tuesday, March 24, 2015 at 4:06:09 PM UTC+1, Blake McBride wrote:

I am attempting to define a mapping. I am first creating a new index by
adding a document that doesn't contain anything specified in my
mapping/schema. I am using a bulk operation to set the mapping but I get
an ActionRequestValidationException error each time. Here is my JS code:

var mappings = {
"body": [
{ "mappings": {
"component": {
"properties": {
"classifications": {
"type": "string",
"index": "not_analyzed"
}
}
}
}}
]
};
client.bulk(mappings, function(err, resp){
// error appears here
});

The exact message I get is: ActionRequestValidationException[Validation Failed: 1: no requests added;]

Any help would sure be appreciated.

Blake McBride

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/dcc42ef8-7a5e-47ac-8953-2a873cb172da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yea. Thanks. As you suggested, I bypassed the JS API and just did an HTTP
call. That worked. Thanks.

On Wednesday, March 25, 2015 at 2:51:47 AM UTC-5, Boaz Leskes wrote:

Hi Blake,

I'm not an expert in the JS client, but the bulk requests are meant for
indexing data. If you want to set the mapping you can do it in index
creation time or by using the dedicate put mapping API (
Update mapping API | Elasticsearch Guide [8.11] | Elastic
).

Cheers,
Boaz

On Tuesday, March 24, 2015 at 4:06:09 PM UTC+1, Blake McBride wrote:

I am attempting to define a mapping. I am first creating a new index by
adding a document that doesn't contain anything specified in my
mapping/schema. I am using a bulk operation to set the mapping but I get
an ActionRequestValidationException error each time. Here is my JS code:

var mappings = {
"body": [
{ "mappings": {
"component": {
"properties": {
"classifications": {
"type": "string",
"index": "not_analyzed"
}
}
}
}}
]
};
client.bulk(mappings, function(err, resp){
// error appears here
});

The exact message I get is: ActionRequestValidationException[Validation Failed: 1: no requests added;]

Any help would sure be appreciated.

Blake McBride

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9b829078-fd15-4c3a-b356-bcacd429a7bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.