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 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 <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+unsubscr...@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.

Reply via email to