Skip to content

Instantly share code, notes, and snippets.

@jshirley
Created May 20, 2012 14: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 jshirley/2758363 to your computer and use it in GitHub Desktop.
Save jshirley/2758363 to your computer and use it in GitHub Desktop.
Index Mapping
[2012-05-20 07:46:06,920][DEBUG][action.search.type ] [Zaladane] [kb-post][0], node[Z2lVjAo1TaeFK4xFJ7seMQ], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@3227f076]
org.elasticsearch.search.SearchParseException: [kb-post][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"query":{"has_child":{"type":"kb-post-tag","query":{"text":{"tag":"question"}}}}}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:557)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:469)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:228)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)
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:680)
>>>>
Caused by: org.elasticsearch.index.query.QueryParsingException: [kb-post] [has_child] Type [kb-post-tag] does not have parent mapping
>>>>
at org.elasticsearch.index.query.HasChildQueryParser.parse(HasChildQueryParser.java:101)
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:192)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:243)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:223)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:545)
... 10 more
{
"kb-post" : {
"kb-post" : {
"properties" : {
"dt_created" : {
"format" : "dateOptionalTime",
"type" : "date"
},
"score" : {
"type" : "string"
},
"parent_id" : {
"type" : "long"
},
"body" : {
"type" : "string"
},
"summary" : {
"type" : "string"
},
"dt_updated" : {
"format" : "dateOptionalTime",
"type" : "date"
},
"person" : { /* snip */ }
"action" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
}
},
"kb-post-tag" : {
"_parent" : {
"type" : "kb-post"
},
"properties" : {
"tag" : {
"type" : "string"
},
"parent_pk1" : {
"type" : "string"
},
"parent_id" : {
"type" : "string"
}
}
}
}
}
{
"query": {
"has_child": {
"type": "kb-post-tag",
"query": {
"text": {
"tag": "question"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment