报错信息如下
elasticsearch.exceptions.TransportError: TransportError(500, 'search_phase_execution_exception', 'Result window is too large, from + size must be less than or equal to
解决办法:
在创建索引的时候添加:
mappings = { "mappings": { "numerical_keyword": { "properties": { "search_keyword": { # 搜索关键词 "type": "text", "index": "true" } } } }, "settings": { "index": { "max_result_window": 500000 # 数量限制,可以自己定义 } } }
这个办法可以完美解决