elasticsearch 错误

2016-02-01 00:48:54 +08:00
 wico77

[2016-01-30 23:58:36,565][DEBUG][action.search.type ] [Razorback] [.marvel-2016.01.22][0], node[7B-RkEI5Rq2uLL2yqg3CPA], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@2c72a34] lastShard [true]
org.elasticsearch.search.SearchParseException: [.marvel-2016.01.22][0]: query[ConstantScore(:)],from[20],size[10]: Parse Failure [Failed to parse source [{"from":20,"size":10,"sort":[{"random_key":{"order":"desc"}}]}]]
at org.elasticsearch.search.SearchService.parseSource(SearchService.java:721)
at org.elasticsearch.search.SearchService.createContext(SearchService.java:558)
at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:529)
at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:291)
at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231)
at org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228)
at org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.elasticsearch.search.SearchParseException: [.marvel-2016.01.22][0]: query[ConstantScore(:)],from[20],size[10]: Parse Failure [No mapping found for [random_key] in order to sort on]
mongodb 数据库里的有些格式貌似没有 random_key 字段,然后 ES 排序错误,请问如何解决

1634 次点击
所在节点    问与答
2 条回复
wico77
2016-02-01 00:59:09 +08:00
ES 里有个 ignore_unmapped 选项,不知道 pyes 里怎么设置 ignore_unmapped
vietor
2016-02-01 07:05:12 +08:00
加一个检查 random_key de filter

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/254689

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX