當前位置: 首頁>>代碼示例>>Java>>正文


Java NamedList.getAll方法代碼示例

本文整理匯總了Java中org.apache.solr.common.util.NamedList.getAll方法的典型用法代碼示例。如果您正苦於以下問題:Java NamedList.getAll方法的具體用法?Java NamedList.getAll怎麽用?Java NamedList.getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.solr.common.util.NamedList的用法示例。


在下文中一共展示了NamedList.getAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: inform

import org.apache.solr.common.util.NamedList; //導入方法依賴的package包/類
public void inform(SolrCore core) {
    super.inform(core);
    suggestionService = new SuggestionService(core,this.getInitArgs());

    //set default args
    NamedList args = (NamedList)this.getInitArgs().get("defaults");

    SUGGESTION = args.get(SuggestionRequestParams.SUGGESTION) != null ?
            Boolean.parseBoolean((String)args.get(SuggestionRequestParams.SUGGESTION)) : SUGGESTION;
    TERM_LIMIT = args.get(SuggestionRequestParams.SUGGESTION_TERM_LIMIT) != null ?
            Integer.parseInt((String)args.get(SuggestionRequestParams.SUGGESTION_TERM_LIMIT)) : TERM_LIMIT;

    LIMIT = args.get(SuggestionRequestParams.SUGGESTION_LIMIT) != null ?
            Integer.parseInt((String)args.get(SuggestionRequestParams.SUGGESTION_LIMIT)) : LIMIT;

    LIMIT_TYPE = args.get(SuggestionRequestParams.SUGGESTION_LIMIT_TYPE) != null ?
            LimitType.parse((String) args.get(SuggestionRequestParams.SUGGESTION_LIMIT_TYPE), LIMIT_TYPE) : LIMIT_TYPE;

    DF = args.get(SuggestionRequestParams.SUGGESTION_DF) != null ?
            (String) args.get(SuggestionRequestParams.SUGGESTION_DF) : DF;

    STRATEGY = args.get(SuggestionRequestParams.SUGGESTION_STRATEGY) != null ?
            Strategy.parse((String)args.get(SuggestionRequestParams.SUGGESTION_STRATEGY), STRATEGY) :STRATEGY;

    List<String> fields = args.getAll(SuggestionRequestParams.SUGGESTION_FIELD) != null ?
            args.getAll(SuggestionRequestParams.SUGGESTION_FIELD) : Collections.emptyList();
    if(!fields.isEmpty()) {
        FIELDS = fields.toArray(new String[fields.size()]);
    }

    List<String> multivalue_fields = args.getAll(SuggestionRequestParams.SUGGESTION_MULTIVALUE_FIELD) != null ?
            args.getAll(SuggestionRequestParams.SUGGESTION_MULTIVALUE_FIELD) : Collections.emptyList();
    if(!multivalue_fields.isEmpty()) {
        MULTIVALUE_FIELDS = fields.toArray(new String[multivalue_fields.size()]);
    }

    List<String> fqs = args.getAll(CommonParams.FQ) != null ?
            args.getAll(CommonParams.FQ) : Collections.emptyList();
    if(!fqs.isEmpty()) {
        FQS = fqs.toArray(new String[fields.size()]);
    }

}
 
開發者ID:RBMHTechnology,項目名稱:vind,代碼行數:44,代碼來源:SuggestionRequestHandler.java


注:本文中的org.apache.solr.common.util.NamedList.getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。