当前位置: 首页>>代码示例>>Java>>正文


Java NamedList.addAll方法代码示例

本文整理汇总了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;
}
 
开发者ID:upenn-libraries,项目名称:solrplugins,代码行数:12,代码来源:ProofOfConceptPayloadHandler.java

示例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));
        }
    }
}
 
开发者ID:DiceTechJobs,项目名称:RelevancyFeedback,代码行数:48,代码来源:UnsupervisedFeedbackHandler.java

示例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));
            }
        }
    }
 
开发者ID:DiceTechJobs,项目名称:RelevancyFeedback,代码行数:48,代码来源:RelevancyFeedbackHandler.java


注:本文中的org.apache.solr.common.util.NamedList.addAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。