elastcisearch search流程
2018-11-01 16:12:17 6 举报
elastcisearch search流程
作者其他创作
大纲/内容
AggregationPhase.execute
reduce结果(hits、aggs)
向每个shard发起请求
SearchService.executeQueryPhase
SearchDfsQueryThenFetchAsyncAction.start
SearchQueryThenFetchAsyncAction.executePhaseOnShard
SearchActionListener.innerOnResponse
SearchService.executeFetchPhase
clientnode接收search请求
执行query流程
响应FETCH_ID_ACTION_NAME请求
InitialSearchPhase.run
SearchService.createAndPutContext
得到shard的fetch结果
所有shard均返回?
SearchService.rewriteShardRequest
search类型
client node
SuggestPhase.execute
data node
SearchTransportService.sendExecuteQuery
FetchSearchPhase.innerRun
InitialSearchPhase.performPhaseOnShard
得到shard的query结果
向每个shard发起fetch结果
TransportSearchAction.doExecute
TransportSearchAction.searchAsyncAction
响应QUERY_ACTION的search请求
SearchPhaseController.merge
SearchQueryThenFetchAsyncAction.start
执行fetch请求
向每个shard发起search请求
QueryPhase.execute
DFS_QUERY_THEN_FETCH
是
shard请求结束
执行aggression等查询
解析search请求,将dsl转换成lucene的query对象,创建searchContext对象
SearchPhaseController.reducedQueryPhase
SearchService.findContext
FetchSearchPhase.executeFetch
end
InitialSearchPhase.onShardResult
TransportSearchAction.executeSearch
SearchService.loadOrExecuteQueryPhase
AbstractSearchAsyncAction.onPhaseDone
加入search线程池执行请求
IndexSearcher.search
InitialSearchPhase.successfulShardExecution
RestSearchAction.prepareRequest
确认请求是否被cache了,cache了,就返回cache结果
QUERY_THEN_FETCH
AbstractSearchAsyncAction.executePhase
FetchSearchPhase.sendResponsePhase
searchType?
FetchPhase.execute
否
clientnode预处理(获取查询的shard列表)
SearchTransportService.sendExecuteFetch
merge shard的hits结果
FetchSearchPhase.moveToNextPhase
AbstractSearchAsyncAction.executeNextPhase
TransportService.sendChildRequest
0 条评论
回复 删除
下一页