2014-03-03 251 views
11

我跑elasticsearchElasticsearch:SearchPhaseExecutionException /解析失敗

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 [[email protected]] 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 [[email protected]] 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 [[email protected]] 
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 [[email protected]] 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.e[email protected]] 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" 
    } 
  } 
}' 
+1

對於任何可能閱讀此內容的人,請確保您使用的是ElasticSearch服務器的正確版本,我在本地環境中運行1.3.2,同時我的同事正在運行1.4,並且ElasticSearch生成的查詢生成類位於頂部1.4的功能,所以我崩潰 – mxlfa

回答

2

你得到一個錯誤,因爲Elasticsearch不知道什麼是現場查詢:No query registered for [field]]

如果你想查找文檔,其中標題字段包含CA,你可以這樣做:

{ 
    "query": { 
    "query_string": { 
     "query": "title:ca" 
    } 
    } 
} 
+0

我得到幾乎相同的錯誤ElasticsearchIllegalArgumentException [Suggester [query_string]不支持]' – user2158382

+0

上面的查詢是爲_search端點,而不是_suggest。你是否試圖在標題中搜索ca,或者獲取建議? – kielni

+0

在第一個示例中,我試圖在第二個搜索中尋找建議 – user2158382

11

當您在搜索彈性捲上運行的磁盤空間,您還可以得到這個錯誤。

3

在Marvel/Sense中執行,在/ _search命令後搜索空間。這也觸發解析異常。

+0

omg,那太愚蠢了!當真正的問題是* sense *中的無形空間時,尋找原因丟失2個小時,閱讀日誌,集羣健康和檢查錯誤。謝謝,Thiago Bussiki! :) – bosch

3

檢查您的Elastic服務器是否有足夠的可用磁盤空間/ RAM。

對我來說磁盤空間是個問題。

2

對我來說,問題是沒有記錄包含在Searchkick中的一個表。確保每個表格中至少有一條記錄,然後rake db:reindex:all並再試一次。