HttpSolrCall是solr底层发送http请求的中转站,首先看一下它的构造函数
public HttpSolrCall(SolrDispatchFilter solrDispatchFilter, CoreContainer cores,
HttpServletRequest request, HttpServletResponse response, boolean retry) {
this.solrDispatchFilter = solrDispatchFilter;
this.cores = cores;
this.req = request;
this.response = response;
this.retry = retry;
this.requestType = RequestType.UNKNOWN;
queryParams = SolrRequestParsers.parseQueryString(req.getQueryString());
}
没有什么特别之处,主要是进行了一些赋值操作
接下来这个类里面有个 private void init() throws Exception {}方法
主要是解析req从中获取core名称,并向req中写入一些属性,初始化一些core相关的参数,检查core在不在corecontainer中,并做一些错误异常抛出的处理,以及得到当前url的action类型。在这个方法里还调用了一个方法
extractHandlerFromURLPath(SolrRequestParsers parser) throws Exception {}
此方法从ur