# Type \[XXX\] does not have parent mapping

**URL:** <https://discuss.elastic.co/t/type-xxx-does-not-have-parent-mapping/6686>\
**Category:** Elasticsearch\
**Created:** [February 13, 2012, 10:49am UTC](https://discuss.elastic.co/t/type-xxx-does-not-have-parent-mapping/6686 "2012-02-13T10:49:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wojciech\_Durczynski](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@Wojciech\_Durczynski](https://discuss.elastic.co/u/Wojciech_Durczynski)\
**Post date:** [February 13, 2012, 10:49am UTC](https://discuss.elastic.co/t/type-xxx-does-not-have-parent-mapping/6686/1 "2012-02-13T10:49:50Z")

</div>

Hello. I use ES 0.18.6 and after creating new type with parent mapping I  
always have a problem: Type [offeringsAvailabilityCheck] does not have  
parent mapping.  
But this type of course has parent mapping:  
$ curl  
[http://localhost:9200/om\_fcdfac3b-fe50-4ef0-a85b-46ce8cc7eaf5/offeringsAvailabilityCheck/\_mapping](http://localhost:9200/om_fcdfac3b-fe50-4ef0-a85b-46ce8cc7eaf5/offeringsAvailabilityCheck/_mapping)  
{"offeringsAvailabilityCheck":{"dynamic\_templates":[{"multi\_field\_strings":{"mapping":{"index":"not\_analyzed","type":"string"},"match\_mapping\_type":"string","match":"\*"}}],"properties":{"status":{"index":"not\_analyzed","type":"string"},"orderId":{"index":"not\_analyzed","type":"string"},"addressId":{"index":"not\_analyzed","type":"string"}},"dynamic\_date\_formats":["basic\_date\_time"],"\_parent":{"type":"availableOffering"}}}  
I try to do usual search query (not count) on type availableOffering with  
has\_child filter and facets.  
Refreshing or flushing of index doesn't help but restarting of cluster  
always helps - problem disappears, so it's probably something with cache or  
transaction log.

Whole stack trace:  
org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to  
execute phase [query\_fetch], total failure; shardFailures  
{[UMIUM3shTeW3o95Cd-gh\_w][om\_fcdfac3b-fe50-4ef0-a85b-46ce8cc7eaf5][0]:  
RemoteTransportException[[Fer-de-Lance][inet[/10.132.4.68:9300]][search/phase/query+fetch]];  
nested: SearchParseException[[om\_fcdfac3b-fe50-4ef0-a85b-46ce8cc7eaf5][0]:  
from[0],size[1]: Parse Failure [Failed to parse source [_na_]]]; nested:  
QueryParsingException[[om\_fcdfac3b-fe50-4ef0-a85b-46ce8cc7eaf5] Type  
[offeringsAvailabilityCheck] does not have parent mapping]; }  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:258)  
at  
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$3.onFailure(TransportSearchTypeAction.java:211)  
at  
org.elasticsearch.search.action.SearchServiceTransportAction$5.handleException(SearchServiceTransportAction.java:241)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:278)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:269)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.process(MessageChannelHandler.java:221)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.callDecode(MessageChannelHandler.java:147)  
at  
org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:103)  
at  
org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)  
at  
org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)  
at  
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:274)  
at  
org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:261)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:351)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202)  
at  
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at  
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

**Author:** ![Wojciech\_Durczynski](https://avatars.discourse-cdn.com/v4/letter/w/fbc32d/32.png) [@Wojciech\_Durczynski](https://discuss.elastic.co/u/Wojciech_Durczynski)\
**Post date:** [February 13, 2012, 11:13am UTC](https://discuss.elastic.co/t/type-xxx-does-not-have-parent-mapping/6686/2 "2012-02-13T11:13:20Z")

</div>

My query looks like this:

{  
"from" : 0,  
"size" : 1,  
"query" : {  
"filtered" : {  
"query" : {  
"match\_all" : {  
}  
},  
"filter" : {  
"and" : {  
"filters" : [ {  
"not" : {  
"filter" : {  
"exists" : {  
"field" : "details.scope"  
}  
}  
}  
}, {  
"term" : {  
"details.vendor.id" : "836857e2-6a44-423e-b9d5-75607c728d5d"  
}  
}, {  
"term" : {  
"details.providedBySalesChannels.id" :  
"ff679d72-085a-4430-9979-6fdea980056f"  
}  
}, {  
"or" : {  
"filters" : [ {  
"term" : {  
"availabilityCheckNeeded" : "false"  
}  
}, {  
"has\_child" : {  
"query" : {  
"filtered" : {  
"query" : {  
"match\_all" : {  
}  
},  
"filter" : {  
"and" : {  
"filters" : [ {  
"term" : {  
"orderId" :  
"5920f32a-2c74-41e7-8173-54dc71c3aca4"  
}  
}, {  
"term" : {  
"addressId" : "100"  
}  
}, {  
"terms" : {  
"status" : [ "Available",  
"PotentiallyAvailable" ]  
}  
} ]  
}  
}  
}  
},  
"type" : "offeringsAvailabilityCheck"  
}  
} ]  
}  
} ]  
}  
}  
}  
},  
"explain" : false  
}

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 14, 2012, 1:57pm UTC](https://discuss.elastic.co/t/type-xxx-does-not-have-parent-mapping/6686/3 "2012-02-14T13:57:07Z")

</div>

Can you gist a full recreation? ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)).

On Monday, February 13, 2012 at 1:13 PM, Wojciech Durczyński wrote:

> My query looks like this:
> 
> {  
> "from" : 0,  
> "size" : 1,  
> "query" : {  
> "filtered" : {  
> "query" : {  
> "match\_all" : {  
> }  
> },  
> "filter" : {  
> "and" : {  
> "filters" : [ {  
> "not" : {  
> "filter" : {  
> "exists" : {  
> "field" : "details.scope"  
> }  
> }  
> }  
> }, {  
> "term" : {  
> "details.vendor.id" : "836857e2-6a44-423e-b9d5-75607c728d5d"  
> }  
> }, {  
> "term" : {  
> "details.providedBySalesChannels.id" : "ff679d72-085a-4430-9979-6fdea980056f"  
> }  
> }, {  
> "or" : {  
> "filters" : [ {  
> "term" : {  
> "availabilityCheckNeeded" : "false"  
> }  
> }, {  
> "has\_child" : {  
> "query" : {  
> "filtered" : {  
> "query" : {  
> "match\_all" : {  
> }  
> },  
> "filter" : {  
> "and" : {  
> "filters" : [ {  
> "term" : {  
> "orderId" : "5920f32a-2c74-41e7-8173-54dc71c3aca4"  
> }  
> }, {  
> "term" : {  
> "addressId" : "100"  
> }  
> }, {  
> "terms" : {  
> "status" : ["Available", "PotentiallyAvailable"]  
> }  
> } ]  
> }  
> }  
> }  
> },  
> "type" : "offeringsAvailabilityCheck"  
> }  
> } ]  
> }  
> } ]  
> }  
> }  
> }  
> },  
> "explain" : false  
> }

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:39am UTC](https://discuss.elastic.co/t/type-xxx-does-not-have-parent-mapping/6686/4 "2017-07-06T03:39:28Z")

</div>


