我在elasticsearch上运行了以下查询
curl -X GET "http://localhost:9200/games_201403031340/_search?pretty=true" -d '{
"query" : {
"field" : { "title": "ca" }
}
}'
结果我得到了这个错误
"error" : "SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[znmo0cd5Q3S2_ymuDANqKw][games_201403031340][1]: SearchParseException[[games_201403031340][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"query\" : {\n \"field\" : { \"title\": \"ca\" }\n }\n}]]]; nested: QueryParsingException[[games_201403031340] No query registered for [field]]; }{[znmo0cd5Q3S2_ymuDANqKw][games_201403031340][2]: SearchParseException[[games_201403031340][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"query\" : {\n \"field\" : { \"title\": \"ca\" }\n }\n}]]]; nested: QueryParsingException[[games_201403031340] No query registered for [field]]; }{[znmo0cd5Q3S2_ymuDANqKw][games_201403031340][0]: SearchParseException[[games_201403031340][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"query\" : {\n \"field\" : { \"title\": \"ca\" }\n }\n}]]]; nested: QueryParsingException[[games_201403031340] No query registered for [field]]; }{[znmo0cd5Q3S2_ymuDANqKw][games_201403031340][4]: SearchParseException[[games_201403031340][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"query\" : {\n \"field\" : { \"title\": \"ca\" }\n }\n}]]]; nested: QueryParsingException[[games_201403031340] No query registered for [field]]; }{[znmo0cd5Q3S2_ymuDANqKw][games_201403031340][3]: SearchParseException[[games_201403031340][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"query\" : {\n \"field\" : { \"title\": \"ca\" }\n }\n}]]]; nested: QueryParsingException[[games_201403031340] No query registered for [field]]; }]",
"status" : 400
}
这也在我的弹性搜索日志中
[2014-03-03 14:19:15,008][DEBUG][action.search.type ] [Susan Storm] [games_201403031340][1], node[znmo0cd5Q3S2_ymuDANqKw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@f799344] lastShard [true]
org.elasticsearch.search.SearchParseException: [games_201403031340][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{
"query" : {
"field" : { "title": "ca" }
}
}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:586)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:489)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:474)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:467)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
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:680)
Caused by: org.elasticsearch.index.query.QueryParsingException: [games_201403031340] No query registered for [field]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:221)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:321)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:260)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:574)
... 12 more
[2014-03-03 14:19:15,008][DEBUG][action.search.type ] [Susan Storm] [games_201403031340][2], node[znmo0cd5Q3S2_ymuDANqKw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@f799344] lastShard [true]
org.elasticsearch.search.SearchParseException: [games_201403031340][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{
"query" : {
"field" : { "title": "ca" }
}
}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:586)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:489)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:474)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:467)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
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:680)
Caused by: org.elasticsearch.index.query.QueryParsingException: [games_201403031340] No query registered for [field]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:221)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:321)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:260)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:574)
... 12 more
[2014-03-03 14:19:15,008][DEBUG][action.search.type ] [Susan Storm] [games_201403031340][4], node[znmo0cd5Q3S2_ymuDANqKw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@f799344]
org.elasticsearch.search.SearchParseException: [games_201403031340][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{
"query" : {
"field" : { "title": "ca" }
}
}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:586)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:489)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:474)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:467)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
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:680)
Caused by: org.elasticsearch.index.query.QueryParsingException: [games_201403031340] No query registered for [field]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:221)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:321)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:260)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:574)
... 12 more
[2014-03-03 14:19:15,009][DEBUG][action.search.type ] [Susan Storm] All shards failed for phase: [query]
[2014-03-03 14:19:15,008][DEBUG][action.search.type ] [Susan Storm] [games_201403031340][0], node[znmo0cd5Q3S2_ymuDANqKw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@f799344] lastShard [true]
org.elasticsearch.search.SearchParseException: [games_201403031340][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{
"query" : {
"field" : { "title": "ca" }
}
}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:586)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:489)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:474)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:467)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
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:680)
Caused by: org.elasticsearch.index.query.QueryParsingException: [games_201403031340] No query registered for [field]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:221)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:321)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:260)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:574)
... 12 more
[2014-03-03 14:19:15,008][DEBUG][action.search.type ] [Susan Storm] [games_201403031340][3], node[znmo0cd5Q3S2_ymuDANqKw], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@f799344] lastShard [true]
org.elasticsearch.search.SearchParseException: [games_201403031340][3]: from[-1],size[-1]: Parse Failure [Failed to parse source [{
"query" : {
"field" : { "title": "ca" }
}
}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:586)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:489)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:474)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:467)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:239)
at org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:202)
at org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
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:680)
Caused by: org.elasticsearch.index.query.QueryParsingException: [games_201403031340] No query registered for [field]
at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:221)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:321)
at org.elasticsearch.index.query.IndexQueryParserService.parse(IndexQueryParserService.java:260)
at org.elasticsearch.search.query.QueryParseElement.parse(QueryParseElement.java:33)
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:574)
... 12 more
不确定最新情况,但我运行像...这样的查询没有问题。
curl -X POST localhost:9200/games_201403031340/_suggest?pretty=true -d '
{
"apple_game" : {
"text" : "m",
"completion" : {
"field" : "title"
}
}
}'
答案 0 :(得分:11)
当弹性搜索卷上的磁盘空间不足时,也会出现此错误。
答案 1 :(得分:3)
在Marvel / Sense中执行,在/ _search命令后搜索空格。这也是为了触发Parse Exception。
答案 2 :(得分:3)
检查您的Elastic服务器是否有足够的可用磁盘空间/ RAM。
对我来说,磁盘空间是个问题。
答案 3 :(得分:2)
您收到错误,因为Elasticsearch不知道字段查询是什么:No query registered for [field]]
如果您正在尝试查找标题字段包含ca的文档,则可以执行以下操作:
{
"query": {
"query_string": {
"query": "title:ca"
}
}
}
答案 4 :(得分:2)
对我来说,问题是Searchkick中包含的一个表没有记录。确保每个表格中至少有一条记录,然后rake db:reindex:all
,然后重试。