本文整理汇总了Java中org.apache.solr.common.util.NamedList.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java NamedList.addAll方法的具体用法?Java NamedList.addAll怎么用?Java NamedList.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.common.util.NamedList
的用法示例。
在下文中一共展示了NamedList.addAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergePayload
import org.apache.solr.common.util.NamedList; //导入方法依赖的package包/类
@Override
public NamedList<Object> mergePayload(NamedList<Object> preExisting, NamedList<Object> add, long preExistingCount, long addCount) {
if (addCount != ((Number)add.remove("count")).longValue()) {
throw new IllegalStateException("fieldType-internal and -external counts do not match");
}
int countIndex = preExisting.indexOf("count", 0);
long preCount = ((Number)preExisting.getVal(countIndex)).longValue();
preExisting.setVal(countIndex, preCount + addCount);
preExisting.addAll(add);
return preExisting;
}
示例2: addDebugInfo
import org.apache.solr.common.util.NamedList; //导入方法依赖的package包/类
private void addDebugInfo(SolrQueryRequest req, SolrQueryResponse rsp, String q, List<Query> rfFqFilters, RFResult RFResult) {
DocListAndSet rfDocs = RFResult.getResults();
boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);
boolean dbgQuery = false, dbgResults = false;
if (dbg == false){//if it's true, we are doing everything anyway.
String[] dbgParams = req.getParams().getParams(CommonParams.DEBUG);
if (dbgParams != null) {
for (int i = 0; i < dbgParams.length; i++) {
if (dbgParams[i].equals(CommonParams.QUERY)){
dbgQuery = true;
} else if (dbgParams[i].equals(CommonParams.RESULTS)){
dbgResults = true;
}
}
}
} else {
dbgQuery = true;
dbgResults = true;
}
// Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
if (dbg == true) {
try {
NamedList<String> it = getRFTermsForDebug(RFResult.getRFTerms());
NamedList<Object> dbgInfo = new NamedList<Object>();
NamedList<Object> stdDbg = SolrPluginUtils.doStandardDebug(req, q, RFResult.getQuery(), rfDocs.docList, dbgQuery, dbgResults);
if (null != dbgInfo) {
rsp.add("debug", dbgInfo);
dbgInfo.add( "ufTerms", it );
dbgInfo.addAll(stdDbg);
if (null != rfFqFilters) {
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
List<String> fqs = new ArrayList<String>(rfFqFilters.size());
for (Query fq : rfFqFilters) {
fqs.add(QueryParsing.toString(fq, req.getSchema()));
}
dbgInfo.add("uf_filter_queries",fqs);
}
}
} catch (Exception e) {
SolrException.log(log, "Exception during debug", e);
rsp.add("exception_during_debug", SolrException.toStr(e));
}
}
}
示例3: addDebugInfo
import org.apache.solr.common.util.NamedList; //导入方法依赖的package包/类
private void addDebugInfo(SolrQueryRequest req, SolrQueryResponse rsp, String q, List<Query> rfFqFilters, RFHelper rfHelper, RFResult RFResult, DocListAndSet rfDocs) {
boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);
boolean dbgQuery = false, dbgResults = false;
if (dbg == false){//if it's true, we are doing everything anyway.
String[] dbgParams = req.getParams().getParams(CommonParams.DEBUG);
if (dbgParams != null) {
for (int i = 0; i < dbgParams.length; i++) {
if (dbgParams[i].equals(CommonParams.QUERY)){
dbgQuery = true;
} else if (dbgParams[i].equals(CommonParams.RESULTS)){
dbgResults = true;
}
}
}
} else {
dbgQuery = true;
dbgResults = true;
}
// Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
if (dbg == true && RFResult != null) {
try {
NamedList<String> it = getRFTermsForDebug(RFResult);
NamedList<Object> dbgInfo = new NamedList<Object>();
NamedList<Object> stdDbg = SolrPluginUtils.doStandardDebug(req, q, RFResult.getQuery(), rfDocs.docList, dbgQuery, dbgResults);
if (null != dbgInfo) {
rsp.add("debug", dbgInfo);
dbgInfo.add( "RFTerms", it );
dbgInfo.addAll(stdDbg);
if (null != rfFqFilters) {
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
List<String> fqs = new ArrayList<String>(rfFqFilters.size());
for (Query fq : rfFqFilters) {
fqs.add(QueryParsing.toString(fq, req.getSchema()));
}
dbgInfo.add("rf_filter_queries",fqs);
}
}
} catch (Exception e) {
SolrException.log(log, "Exception during debug", e);
rsp.add("exception_during_debug", SolrException.toStr(e));
}
}
}