當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。