Exception when creating a _parent mapping in an index that exists, on a type that exists, with no existing _parent mapping

Hi,

I am trying to add _parent to a type in an index that already exists using.

   PutMappingResponse create = client.admin().indices().preparePutMapping(index).setType(type).setSource("_parent", "type="+parentType).get();

The type exists, due to earlier indexing operations, but the _parent field
does not.
The error reported is

org.elasticsearch.index.mapper.MergeMappingException: Merge failed with failures {[The _parent field's type option can't be changed]}
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:511)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:329)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

This is triggered by the check at [1] which may not be considering the case
where no _parent field exists on a type. I understand that its not
possible to change the type of a _parent, documents created before a
_parent was added will be missing from _parent queries, but since its not
possible to index a document with a parent, before the _parent exists, that
is not a concern.

Having written a battery of unit tests to find out what worked and what did
not, I read the source code and opened a bug [2], which was closed telling
me I was doing it wrong and I needed to ask the list.

My question:
Am I trying to add the _parent mapping correctly?
If I am doing this correctly, is it a bug or the code working as intended
and the only way to add a _parent once an type within an index is created
is to drop the index and reindex. ?

Best Regards
Ian

1
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372

--
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/28472b95-c0c8-4190-a5dd-908a437229ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

On Wednesday, 28 January 2015 08:57:54 UTC, Ian Boston wrote:

Hi,

I am trying to add _parent to a type in an index that already exists
using.

   PutMappingResponse create = client.admin().indices().preparePutMapping(index).setType(type).setSource("_parent", "type="+parentType).get();

The type exists, due to earlier indexing operations, but the _parent field
does not.
The error reported is

org.elasticsearch.index.mapper.MergeMappingException: Merge failed with failures {[The _parent field's type option can't be changed]}
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:511)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:329)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

This is triggered by the check at [1] which may not be considering the
case where no _parent field exists on a type. I understand that its not
possible to change the type of a _parent, documents created before a
_parent was added will be missing from _parent queries, but since its not
possible to index a document with a parent, before the _parent exists, that
is not a concern.

Having written a battery of unit tests to find out what worked and what
did not, I read the source code and opened a bug [2], which was closed
telling me I was doing it wrong and I needed to ask the list.

My question:
Am I trying to add the _parent mapping correctly?
If I am doing this correctly, is it a bug or the code working as intended
and the only way to add a _parent once an type within an index is created
is to drop the index and reindex. ?

Best Regards
Ian

1
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372

Forgot the bug link, sorry.

2 Unable to update a _parent mapping for a type in an index once the index exists, even if no _parent mapping is present for the type. · Issue #9448 · elastic/elasticsearch · GitHub

--
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/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Here is what I wrote about this on the issue:

Indeed. I can reproduce your "issue" using REST. So it's not related to Java API.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}
Gives:

{
"error": "MergeMappingException[Merge failed with failures {[The _parent field's type option can't be changed]}]",
"status": 400
}
This is by design. See here: https://github.com/elasticsearch/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L367-370 https://github.com/elasticsearch/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L367-370

BTW if you have no document already you can remove the type.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

DELETE test/_mapping/child

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}
This is working.

Hope this helps

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 28 janv. 2015 à 10:29, Ian Boston ianboston@gmail.com a écrit :

On Wednesday, 28 January 2015 08:57:54 UTC, Ian Boston wrote:
Hi,

I am trying to add _parent to a type in an index that already exists using.

   PutMappingResponse create = client.admin().indices().preparePutMapping(index).setType(type).setSource("_parent", "type="+parentType).get();

The type exists, due to earlier indexing operations, but the _parent field does not.
The error reported is

org.elasticsearch.index.mapper.MergeMappingException: Merge failed with failures {[The _parent field's type option can't be changed]}
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:511)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:329)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

This is triggered by the check at [1] which may not be considering the case where no _parent field exists on a type. I understand that its not possible to change the type of a _parent, documents created before a _parent was added will be missing from _parent queries, but since its not possible to index a document with a parent, before the _parent exists, that is not a concern.

Having written a battery of unit tests to find out what worked and what did not, I read the source code and opened a bug [2], which was closed telling me I was doing it wrong and I needed to ask the list.

My question:
Am I trying to add the _parent mapping correctly?
If I am doing this correctly, is it a bug or the code working as intended and the only way to add a _parent once an type within an index is created is to drop the index and reindex. ?

Best Regards
Ian

1 https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372 https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372

Forgot the bug link, sorry.

2 Unable to update a _parent mapping for a type in an index once the index exists, even if no _parent mapping is present for the type. · Issue #9448 · elastic/elasticsearch · GitHub https://github.com/elasticsearch/elasticsearch/issues/9448

--
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 mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout 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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/781810F2-BC9F-44A0-ABC1-F1E51D725F07%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Hi,
Thanks for the clarification.

How do others do DevOps style updates to Elastic Search based deployments,
where the updates evolve the index ?

Is the advice to avoid the _parent feature completely ?

Are there other mappings that behave in the same way that I should be aware
of ?

The size and realtime nature of both the data set and application I am
dealing with prohibits dropping an index without taking the application
offline.... and that would instantly break all SLA's.

Best Regards
Ian

On Wednesday, 28 January 2015 09:36:32 UTC, David Pilato wrote:

Here is what I wrote about this on the issue:

Indeed. I can reproduce your "issue" using REST. So it's not related to
Java API.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}

Gives:

{
"error": "MergeMappingException[Merge failed with failures {[The _parent field's type option can't be changed]}]",
"status": 400
}

This is by design. See here:
https://github.com/elasticsearch/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L367-370

BTW if you have no document already you can remove the type.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

DELETE test/_mapping/child

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}

This is working.

Hope this helps

--
David Pilato | Technical Advocate | Elasticsearch.com
http://Elasticsearch.com

@dadoonet https://twitter.com/dadoonet | @elasticsearchfr
https://twitter.com/elasticsearchfr | @scrutmydocs
https://twitter.com/scrutmydocs

Le 28 janv. 2015 à 10:29, Ian Boston <ianb...@gmail.com <javascript:>> a
écrit :

On Wednesday, 28 January 2015 08:57:54 UTC, Ian Boston wrote:

Hi,

I am trying to add _parent to a type in an index that already exists
using.

   PutMappingResponse create = client.admin().indices().preparePutMapping(index).setType(type).setSource("_parent", "type="+parentType).get();

The type exists, due to earlier indexing operations, but the _parent
field does not.
The error reported is

org.elasticsearch.index.mapper.MergeMappingException: Merge failed with failures {[The _parent field's type option can't be changed]}
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:511)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:329)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

This is triggered by the check at [1] which may not be considering the
case where no _parent field exists on a type. I understand that its not
possible to change the type of a _parent, documents created before a
_parent was added will be missing from _parent queries, but since its not
possible to index a document with a parent, before the _parent exists, that
is not a concern.

Having written a battery of unit tests to find out what worked and what
did not, I read the source code and opened a bug [2], which was closed
telling me I was doing it wrong and I needed to ask the list.

My question:
Am I trying to add the _parent mapping correctly?
If I am doing this correctly, is it a bug or the code working as intended
and the only way to add a _parent once an type within an index is created
is to drop the index and reindex. ?

Best Regards
Ian

1
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372

Forgot the bug link, sorry.

2 Unable to update a _parent mapping for a type in an index once the index exists, even if no _parent mapping is present for the type. · Issue #9448 · elastic/elasticsearch · GitHub

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2af1b167-af2c-440e-8c66-d9c49988aa1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

What you often do in this context is to use alias on top of your index. Then reindex everything in another index with new settings. And switch the alias.
No downtime.

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 28 janv. 2015 à 11:56, Ian Boston ianboston@gmail.com a écrit :

Hi,
Thanks for the clarification.

How do others do DevOps style updates to Elastic Search based deployments, where the updates evolve the index ?

Is the advice to avoid the _parent feature completely ?

Are there other mappings that behave in the same way that I should be aware of ?

The size and realtime nature of both the data set and application I am dealing with prohibits dropping an index without taking the application offline.... and that would instantly break all SLA's.

Best Regards
Ian

On Wednesday, 28 January 2015 09:36:32 UTC, David Pilato wrote:
Here is what I wrote about this on the issue:

Indeed. I can reproduce your "issue" using REST. So it's not related to Java API.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}
Gives:

{
"error": "MergeMappingException[Merge failed with failures {[The _parent field's type option can't be changed]}]",
"status": 400
}
This is by design. See here: https://github.com/elasticsearch/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L367-370 https://github.com/elasticsearch/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L367-370

BTW if you have no document already you can remove the type.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

DELETE test/_mapping/child

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}
This is working.

Hope this helps

--
David Pilato | Technical Advocate | Elasticsearch.com http://elasticsearch.com/
@dadoonet https://twitter.com/dadoonet | @elasticsearchfr https://twitter.com/elasticsearchfr | @scrutmydocs https://twitter.com/scrutmydocs

Le 28 janv. 2015 à 10:29, Ian Boston <ianb...@ <>gmail.com http://gmail.com/> a écrit :

On Wednesday, 28 January 2015 08:57:54 UTC, Ian Boston wrote:
Hi,

I am trying to add _parent to a type in an index that already exists using.

   PutMappingResponse create = client.admin().indices().preparePutMapping(index).setType(type).setSource("_parent", "type="+parentType).get();

The type exists, due to earlier indexing operations, but the _parent field does not.
The error reported is

org.elasticsearch.index.mapper.MergeMappingException: Merge failed with failures {[The _parent field's type option can't be changed]}
at org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:511)
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:329)
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

This is triggered by the check at [1] which may not be considering the case where no _parent field exists on a type. I understand that its not possible to change the type of a _parent, documents created before a _parent was added will be missing from _parent queries, but since its not possible to index a document with a parent, before the _parent exists, that is not a concern.

Having written a battery of unit tests to find out what worked and what did not, I read the source code and opened a bug [2], which was closed telling me I was doing it wrong and I needed to ask the list.

My question:
Am I trying to add the _parent mapping correctly?
If I am doing this correctly, is it a bug or the code working as intended and the only way to add a _parent once an type within an index is created is to drop the index and reindex. ?

Best Regards
Ian

1 https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372 https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372

Forgot the bug link, sorry.

2 Unable to update a _parent mapping for a type in an index once the index exists, even if no _parent mapping is present for the type. · Issue #9448 · elastic/elasticsearch · GitHub https://github.com/elasticsearch/elasticsearch/issues/9448

--
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 elasticsearc...@ <>googlegroups.com http://googlegroups.com/.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout 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 elasticsearch+unsubscribe@googlegroups.com mailto:elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2af1b167-af2c-440e-8c66-d9c49988aa1f%40googlegroups.com https://groups.google.com/d/msgid/elasticsearch/2af1b167-af2c-440e-8c66-d9c49988aa1f%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout 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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/AC9FD4D8-C0AC-460E-8ECD-59FD8DB074BB%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Hi,
Perfect, thanks.
Best Regards
Ian

On 28 January 2015 at 11:04, David Pilato david@pilato.fr wrote:

What you often do in this context is to use alias on top of your index. Then
reindex everything in another index with new settings. And switch the alias.
No downtime.

HTH

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 28 janv. 2015 à 11:56, Ian Boston ianboston@gmail.com a écrit :

Hi,
Thanks for the clarification.

How do others do DevOps style updates to Elastic Search based deployments,
where the updates evolve the index ?

Is the advice to avoid the _parent feature completely ?

Are there other mappings that behave in the same way that I should be aware
of ?

The size and realtime nature of both the data set and application I am
dealing with prohibits dropping an index without taking the application
offline.... and that would instantly break all SLA's.

Best Regards
Ian

On Wednesday, 28 January 2015 09:36:32 UTC, David Pilato wrote:

Here is what I wrote about this on the issue:

Indeed. I can reproduce your "issue" using REST. So it's not related to
Java API.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}

Gives:

{
"error": "MergeMappingException[Merge failed with failures {[The
_parent field's type option can't be changed]}]",
"status": 400
}

This is by design. See here:
https://github.com/elasticsearch/elasticsearch/blob/1.4/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L367-370

BTW if you have no document already you can remove the type.

DELETE test
PUT test

PUT /test/_mapping/parent
{
"properties": {}
}

PUT /test/_mapping/child
{
"properties": {}
}

DELETE test/_mapping/child

PUT /test/_mapping/child
{
"_parent": {
"type": "new_parent"
}
}

This is working.

Hope this helps

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 28 janv. 2015 à 10:29, Ian Boston ianb...@gmail.com a écrit :

On Wednesday, 28 January 2015 08:57:54 UTC, Ian Boston wrote:

Hi,

I am trying to add _parent to a type in an index that already exists
using.

   PutMappingResponse create =

client.admin().indices().preparePutMapping(index).setType(type).setSource("_parent",
"type="+parentType).get();

The type exists, due to earlier indexing operations, but the _parent
field does not.
The error reported is

org.elasticsearch.index.mapper.MergeMappingException: Merge failed with
failures {[The _parent field's type option can't be changed]}
at
org.elasticsearch.cluster.metadata.MetaDataMappingService$4.execute(MetaDataMappingService.java:511)
at
org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:329)
at
org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:153)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

This is triggered by the check at [1] which may not be considering the
case where no _parent field exists on a type. I understand that its not
possible to change the type of a _parent, documents created before a _parent
was added will be missing from _parent queries, but since its not possible
to index a document with a parent, before the _parent exists, that is not a
concern.

Having written a battery of unit tests to find out what worked and what
did not, I read the source code and opened a bug [2], which was closed
telling me I was doing it wrong and I needed to ask the list.

My question:
Am I trying to add the _parent mapping correctly?
If I am doing this correctly, is it a bug or the code working as intended
and the only way to add a _parent once an type within an index is created is
to drop the index and reindex. ?

Best Regards
Ian

1
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java#L372

Forgot the bug link, sorry.

2 Unable to update a _parent mapping for a type in an index once the index exists, even if no _parent mapping is present for the type. · Issue #9448 · elastic/elasticsearch · GitHub

--
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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/bbb9d2c0-3eb1-4afc-a0f5-62af0e443ca1%40googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/2af1b167-af2c-440e-8c66-d9c49988aa1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/rHYGOcwTXPU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/AC9FD4D8-C0AC-460E-8ECD-59FD8DB074BB%40pilato.fr.

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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAH%3DGj-mO%2Bte36%3DCUxf65jha6scUatRsiczcKLjO43-Yj4P0rkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.