Elasticsearch: SearchPhaseExecutionException/Ошибка анализа

Я выполнил следующий запрос по 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 [[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 [[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

Вы также получите эту ошибку, когда закончите работу с дисковым пространством на вашем томе с эластичным поиском.

Ответ 2

Выполняя в Marvel/Sense, найдите команду пробел после /_search. Это также вызовет исключение Parse.

Ответ 3

Убедитесь, что на вашем Elastic сервере достаточно свободного места на диске/ОЗУ.

Для меня было дисковое пространство.

Ответ 4

Вы получаете сообщение об ошибке, потому что Elasticsearch не знает, что такое полевой запрос: No query registered for [field]]

Если вы пытаетесь найти документы, в которых поле заголовка содержит ca, вы можете сделать это:

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

Ответ 5

Для меня проблема не была записью для одной из таблиц, включенных в Searchkick. Убедитесь, что у вас есть по крайней мере одна запись в каждой таблице, затем rake db:reindex:all и повторите попытку.