public QParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
this.qstr = qstr;
this.localParams = localParams;
if (localParams != null) {
String tagStr = localParams.get(CommonParams.TAG);
if (tagStr != null) {
Map context = req.getContext();
Map<String,Collection<Object>> tagMap = (Map<String, Collection<Object>>)req.getContext().get("tags");
if (tagMap == null) {
tagMap = new HashMap<String,Collection<Object>>();
context.put("tags", tagMap);
}
if (tagStr.indexOf(',') >= 0) {
List<String> tags = StrUtils.splitSmart(tagStr, ',');
for (String tag : tags) {
addTag(tagMap, tag, this);
}
} else {
addTag(tagMap, tagStr, this);
}
}
}
this.params = params;
this.req = req;
}