Thanks Jörg for the prompt answer. However, for security reason with have
disabled the option rest.action.multi.allow_explicit_index (
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/url-access-control.html
).
So, in this case using:
POST /_bulk
{ "index" : { "_index": "foo", "_type": "bar", "_id" : "1" } }
{ "baz": "foobar" }
I am getting this exception:
{
"error": "ElasticsearchIllegalArgumentException[explicit index in bulk
is not allowed]",
"status": 400
}
Is there any way to insert a document, specifying the id, in the bulk mode
with "no explicit index in bulk", as this code doesn't work:
POST /foo/bar/_bulk
{ "index": {} }
{ "_id" : "1", "baz": "foobar" }
Is this a bug?
Il giorno giovedì 23 ottobre 2014 10:27:34 UTC+1, Jörg Prante ha scritto:
>
> The bulk format does not allow _id in the payload line, you confuse the
> indexer.
>
> Use something like
>
> POST /_bulk
> { "index" : { "_index": "foo", "_type": "bar", "_id" : "1" } }
> { "baz": "foobar" }
>
> Jörg
>
>
> On Wed, Oct 22, 2014 at 8:47 PM, Niccolò Becchi <[email protected]
> <javascript:>> wrote:
>
>> This issue looks to be fixed on
>> https://github.com/elasticsearch/elasticsearch/issues/4668
>>
>> However, on elasticsearch-1.3.4, running the example with
>> rest.action.multi.allow_explicit_index: false:
>> ```
>> POST /foo/bar/_bulk
>> { "index": {} }
>> { "_id" : "1", "baz": "foobar" }
>> ```
>> I am getting the exception:
>> ```
>> {
>> "took": 1,
>> "errors": true,
>> "items": [
>> {
>> "create": {
>> "_index": "foo",
>> "_type": "bar",
>> "_id": "oX0Xp8dzRbySZiKX8QI0zw",
>> "status": 400,
>> "error": "MapperParsingException[failed to parse [_id]];
>> nested: MapperParsingException[Provided id [oX0Xp8dzRbySZiKX8QI0zw] does
>> not match the content one [1]]; "
>> }
>> }
>> ]
>> }
>> ```
>> Am I doing something wrong or something has changed?
>>
>> Il giorno giovedì 9 gennaio 2014 15:38:46 UTC, Gabe Gorelick-Feldman ha
>> scritto:
>>
>>> Opened an issue: https://github.com/elasticsearch/elasticsearch/
>>> issues/4668
>>>
>>> On Thursday, January 9, 2014 3:39:39 AM UTC-5, Alexander Reelsen wrote:
>>>>
>>>> Hey,
>>>>
>>>> after having a very quick look, it looks like a bug (or wrong
>>>> documentation, need to check further). Can you create a github issue?
>>>>
>>>> Thanks!
>>>>
>>>>
>>>> --Alex
>>>>
>>>>
>>>> On Wed, Jan 8, 2014 at 11:08 PM, Gabe Gorelick-Feldman <
>>>> [email protected]> wrote:
>>>>
>>>>> The documentation on URL-based access control
>>>>> <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/url-access-control.html>
>>>>> implies
>>>>> that _bulk still works if you set rest.action.multi.allow_explicit_index:
>>>>> false, as long as you specify the index in the URL. However, I can't
>>>>> get it to work.
>>>>>
>>>>> POST /foo/bar/_bulk
>>>>> { "index": {} }
>>>>> { "_id": 1234, "baz": "foobar" }
>>>>>
>>>>> returns
>>>>>
>>>>> explicit index in bulk is not allowed
>>>>>
>>>>> Should this work?
>>>>>
>>>>> --
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>>> msgid/elasticsearch/a0d1fa2f-0c28-4142-9f6d-4b28a1695bb3%
>>>>> 40googlegroups.com.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>> --
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/elasticsearch/a9aff019-33c0-4743-9e14-fe3913bcda1c%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/elasticsearch/a9aff019-33c0-4743-9e14-fe3913bcda1c%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/afc96e4b-0625-4cb6-b459-50a1bf560a0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.