您可以通过调用Node stats
API来检查当前打开了多少搜索上下文,但是(据我所知)无法查看它们使用了多少内存:
GET _nodes/stats/indices?filter_path=**.open_contexts
=>
{ "nodes" : { "QjjWj45NQkGC9qcaylDDVQ" : { "indices" : { "search" : { "open_contexts" : 0 } } }, "eZbpkckXSxSxzD8c_QOkEA" : { "indices" : { "search" : { "open_contexts" : 3 } } }, "0VFJaC2uTraudPCMqODhiw" : { "indices" : { "search" : { "open_contexts" : 2 } } } }}搜索上下文存储在堆中。
此外,该
keepAlive参数指示上下文在自动清除之前在内存中保持可用状态的时间。



