Skip to content

Instantly share code, notes, and snippets.

@mrvisser
Last active December 31, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrvisser/8055795 to your computer and use it in GitHub Desktop.
Save mrvisser/8055795 to your computer and use it in GitHub Desktop.
[2013-12-20 09:47:06,782][DEBUG][action.index ] [Awesome Android] [oaetest][0], node[7mS6-4-aT4Wrgv6kB0hSRg], [P], s[STARTED]: Failed to execute [index {[oaetest][resource][_explain], source[
{
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": [
"q_high^3.0",
"q_low^1.0"
],
"query": "awesome"
}
},
{
"has_child": {
"type": "content_comment",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
},
{
"has_child": {
"type": "discussion_message",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
}
],
"minimum_should_match": 1,
"boost": "1.0"
}
},
"filter": {
"and": [
{
"and": [
{
"term": {
"_type": "resource"
}
}
]
},
{
"or": [
{
"has_child": {
"type": "resource_members",
"query": {
"terms": {
"direct_members": [
"g:camtest:l1NcjbZT3L",
"g:camtest:lkgooW-628",
"u:camtest:lJ79sWW63U"
]
}
}
}
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"or": [
{
"and": [
{
"term": {
"visibility": "public"
}
},
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
}
]
},
{
"and": [
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
},
{
"term": {
"resourceType": "group"
}
},
{
"terms": {
"joinable": [
"yes",
"request"
]
}
}
]
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"term": {
"visibility": "loggedin"
}
}
]
}
]
}
]
}
]
}
]
}
}
},
"size": 10,
"sort": [
{
"_score": {
"order": "desc"
}
},
{
"sort": "asc"
}
],
"min_score": 0.2,
"fields": "*"
}]}]
org.elasticsearch.index.mapper.MapperParsingException: failed to parse [sort]
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:396)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeObject(ObjectMapper.java:515)
at org.elasticsearch.index.mapper.object.ObjectMapper.serializeArray(ObjectMapper.java:592)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:459)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:508)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:452)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareIndex(InternalIndexShard.java:341)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:203)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:533)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:418)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: unknown property [_score]
at org.elasticsearch.index.mapper.core.StringFieldMapper.parseCreateField(StringFieldMapper.java:280)
at org.elasticsearch.index.mapper.core.AbstractFieldMapper.parse(AbstractFieldMapper.java:385)
... 12 more
{
"error": "ElasticSearchIllegalStateException[has_child query hasn't executed properly]",
"status": 500
}
curl -XGET http://localhost:9200/oaetest/resource/d:camtest:xkJhFxanI/_explain -d '
{
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": [
"q_high^3.0",
"q_low^1.0"
],
"query": "awesome"
}
},
{
"has_child": {
"type": "content_comment",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
},
{
"has_child": {
"type": "discussion_message",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
}
],
"minimum_should_match": 1,
"boost": "1.0"
}
},
"filter": {
"and": [
{
"and": [
{
"term": {
"_type": "resource"
}
}
]
},
{
"or": [
{
"has_child": {
"type": "resource_members",
"query": {
"terms": {
"direct_members": [
"g:camtest:l1NcjbZT3L",
"g:camtest:lkgooW-628",
"u:camtest:lJ79sWW63U"
]
}
}
}
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"or": [
{
"and": [
{
"term": {
"visibility": "public"
}
},
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
}
]
},
{
"and": [
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
},
{
"term": {
"resourceType": "group"
}
},
{
"terms": {
"joinable": [
"yes",
"request"
]
}
}
]
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"term": {
"visibility": "loggedin"
}
}
]
}
]
}
]
}
]
}
]
}
}
},
"size": 10,
"sort": [
{
"_score": {
"order": "desc"
}
},
{
"sort": "asc"
}
],
"min_score": 0.2,
"fields": "*"
}' | json
[2013-12-20 10:06:11,532][DEBUG][action.search.type ] [Awesome Android] [oaetest][0], node[7mS6-4-aT4Wrgv6kB0hSRg], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@304053a8]
org.elasticsearch.ElasticSearchIllegalStateException: has_child query hasn't executed properly
at org.elasticsearch.index.search.child.ChildrenQuery.createWeight(ChildrenQuery.java:170)
at org.apache.lucene.search.BooleanQuery$BooleanWeight.<init>(BooleanQuery.java:183)
at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:384)
at org.apache.lucene.search.FilteredQuery.createWeight(FilteredQuery.java:82)
at org.elasticsearch.common.lucene.search.XFilteredQuery.createWeight(XFilteredQuery.java:82)
at org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:687)
at org.elasticsearch.search.internal.ContextIndexSearcher.createNormalizedWeight(ContextIndexSearcher.java:124)
at org.apache.lucene.search.IndexSearcher.explain(IndexSearcher.java:655)
at org.elasticsearch.search.internal.ContextIndexSearcher.explain(ContextIndexSearcher.java:182)
at org.elasticsearch.search.fetch.explain.ExplainFetchSubPhase.hitExecute(ExplainFetchSubPhase.java:72)
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:197)
at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:302)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteFetch(SearchServiceTransportAction.java:304)
at org.elasticsearch.action.search.type.TransportSearchQueryAndFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryAndFetchAction.java:71)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:216)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:203)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:186)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
[2013-12-20 10:06:11,533][DEBUG][action.search.type ] [Awesome Android] All shards failed for phase: [query_fetch]
{
"error": "SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[7mS6-4-aT4Wrgv6kB0hSRg][oaetest][0]: ElasticSearchIllegalStateException[has_child query hasn't executed properly]}]",
"status": 500
}
curl -XGET http://localhost:9200/oaetest/_search -d '
{
"explain": true,
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": [
"q_high^3.0",
"q_low^1.0"
],
"query": "awesome"
}
},
{
"has_child": {
"type": "content_comment",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
},
{
"has_child": {
"type": "discussion_message",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
}
],
"minimum_should_match": 1,
"boost": "1.0"
}
},
"filter": {
"and": [
{
"and": [
{
"term": {
"_type": "resource"
}
}
]
},
{
"or": [
{
"has_child": {
"type": "resource_members",
"query": {
"terms": {
"direct_members": [
"g:camtest:l1NcjbZT3L",
"g:camtest:lkgooW-628",
"u:camtest:lJ79sWW63U"
]
}
}
}
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"or": [
{
"and": [
{
"term": {
"visibility": "public"
}
},
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
}
]
},
{
"and": [
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
},
{
"term": {
"resourceType": "group"
}
},
{
"terms": {
"joinable": [
"yes",
"request"
]
}
}
]
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"term": {
"visibility": "loggedin"
}
}
]
}
]
}
]
}
]
}
]
}
}
},
"size": 10,
"sort": [
{
"_score": {
"order": "desc"
}
},
{
"sort": "asc"
}
],
"min_score": 0.2,
"fields": "*"
}' | json
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 30,
"max_score": null,
"hits": [
{
"_index": "oaetest",
"_type": "resource",
"_id": "d:camtest:xkJhFxanI",
"_score": 1.7801056,
"fields": {
"_extra": "{\"lastModified\":\"1387548959357\"}",
"displayName": "A talk",
"tenantAlias": "camtest",
"visibility": "public",
"description": "about computers",
"resourceType": "discussion"
},
"sort": [
1.7801056,
"A talk about computers"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:eySaFUlTn8",
"_score": 1.2964147,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548879186\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Google",
"displayName": "Google",
"resourceType": "content"
},
"sort": [
1.2964147,
"Google Google"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "d:camtest:gkYUoYxpnU",
"_score": 1.2964147,
"fields": {
"_extra": "{\"lastModified\":\"1387548958458\"}",
"displayName": "Something something discussworthy",
"tenantAlias": "camtest",
"visibility": "loggedin",
"description": "Start discussing this sweet topic",
"resourceType": "discussion"
},
"sort": [
1.2964147,
"Something something discussworthy Start discussing this sweet topic"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:xkXN7Dxp38",
"_score": 1.1227281,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548894261\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Test content description 1",
"displayName": "Test Content 1",
"resourceType": "content"
},
"sort": [
1.1227281,
"Test Content 1 Test content description 1"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:xJzjQvep3U",
"_score": 1.1227281,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548894964\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Test content description",
"displayName": "Test Content",
"resourceType": "content"
},
"sort": [
1.1227281,
"Test Content Test content description"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:eyX8EPep3U",
"_score": 1.1227281,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548896027\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Test content description",
"displayName": "Test Content",
"resourceType": "content"
},
"sort": [
1.1227281,
"Test Content Test content description"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:eylC8lT3L",
"_score": 1.0371318,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548885798\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Google",
"displayName": "Google",
"resourceType": "content"
},
"sort": [
1.0371318,
"Google Google"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:lkgBPep3U",
"_score": 1.0371318,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548897030\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Test content description 1",
"displayName": "Test Content 1",
"resourceType": "content"
},
"sort": [
1.0371318,
"Test Content 1 Test content description 1"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:xkRBveph8",
"_score": 1.0371318,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548898409\"}",
"visibility": "loggedin",
"tenantAlias": "camtest",
"description": "Test content description",
"displayName": "Test Content",
"resourceType": "content"
},
"sort": [
1.0371318,
"Test Content Test content description"
]
},
{
"_index": "oaetest",
"_type": "resource",
"_id": "c:camtest:gkeHBwx6nU",
"_score": 1.0371318,
"fields": {
"resourceSubType": "link",
"_extra": "{\"lastModified\":\"1387548897577\"}",
"visibility": "public",
"tenantAlias": "camtest",
"description": "Test content description",
"displayName": "Test Content",
"resourceType": "content"
},
"sort": [
1.0371318,
"Test Content Test content description"
]
}
]
}
}
curl -XGET http://localhost:9200/oaetest/_search -d '
{
"query": {
"filtered": {
"query": {
"bool": {
"should": [
{
"multi_match": {
"fields": [
"q_high^3.0",
"q_low^1.0"
],
"query": "awesome"
}
},
{
"has_child": {
"type": "content_comment",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
},
{
"has_child": {
"type": "discussion_message",
"query": {
"multi_match": {
"fields": [
"body^0.1"
],
"query": "awesome"
}
},
"score_type": "max"
}
}
],
"minimum_should_match": 1,
"boost": "1.0"
}
},
"filter": {
"and": [
{
"and": [
{
"term": {
"_type": "resource"
}
}
]
},
{
"or": [
{
"has_child": {
"type": "resource_members",
"query": {
"terms": {
"direct_members": [
"g:camtest:l1NcjbZT3L",
"g:camtest:lkgooW-628",
"u:camtest:lJ79sWW63U"
]
}
}
}
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"or": [
{
"and": [
{
"term": {
"visibility": "public"
}
},
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
}
]
},
{
"and": [
{
"or": [
{
"term": {
"tenantAlias": "camtest"
}
}
]
},
{
"term": {
"resourceType": "group"
}
},
{
"terms": {
"joinable": [
"yes",
"request"
]
}
}
]
},
{
"and": [
{
"term": {
"tenantAlias": "camtest"
}
},
{
"term": {
"visibility": "loggedin"
}
}
]
}
]
}
]
}
]
}
]
}
}
},
"size": 10,
"sort": [
{
"_score": {
"order": "desc"
}
},
{
"sort": "asc"
}
],
"min_score": 0.2,
"fields": "*"
}' | json
@mrvisser
Copy link
Author

It appears when you try and explain query with a has_child query, you get an error as shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment