web-dev-qa-db-ja.com

Elasticsearch:SearchPhaseExecutionException / Parse Failure

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
}

これも私のElasticsearchログにありました

[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"
    }
  }
}'
11
user2158382

このエラーは、Elastic Searchボリュームのディスク領域が不足した場合にも発生します。

11
Christopher R

Elasticサーバーに十分な空きディスク容量/ RAMがあることを確認します。

私にとってはディスク容量が問題でした。

3

私にとっては、問題はSearchkickに含まれているテーブルの1つに対する記録ではありませんでした。各テーブルに少なくとも1つのレコードがあることを確認してから、rake db:reindex:all そしてさらに試みる。

3
blisher

Marvel/Senseで実行し、/ _ searchコマンドの後にspaceを検索します。これも解析例外をトリガーします。

3
Thiago Bussiki

Elasticsearchはフィールドクエリが何であるかを認識していないため、エラーが発生します:No query registered for [field]]

タイトルフィールドにcaが含まれているドキュメントを検索する場合は、次のようにします。

{
  "query": {
    "query_string": {
      "query": "title:ca"
    }
  }
}
2
kielni