本文整理匯總了Java中org.apache.solr.common.util.NamedList.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java NamedList.getName方法的具體用法?Java NamedList.getName怎麽用?Java NamedList.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.solr.common.util.NamedList
的用法示例。
在下文中一共展示了NamedList.getName方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toMultiMap
import org.apache.solr.common.util.NamedList; //導入方法依賴的package包/類
/** Create a Map<String,String[]> from a NamedList */
public static Map<String,String[]> toMultiMap(NamedList params) {
HashMap<String,String[]> map = new HashMap<>();
for (int i=0; i<params.size(); i++) {
String name = params.getName(i);
Object val = params.getVal(i);
if (val instanceof String[]) {
MultiMapSolrParams.addParam(name, (String[]) val, map);
} else if (val instanceof List) {
List l = (List) val;
String[] s = new String[l.size()];
for (int j = 0; j < l.size(); j++) {
s[j] = l.get(j) == null ? null : String.valueOf(l.get(j));
}
MultiMapSolrParams.addParam(name, s, map);
} else {
MultiMapSolrParams.addParam(name, val.toString(), map);
}
}
return map;
}
示例2: toMultiMap
import org.apache.solr.common.util.NamedList; //導入方法依賴的package包/類
static Map<String, String[]> toMultiMap(ModifiableSolrParams solrQueryParameter) {
NamedList<Object> namedList = solrQueryParameter.toNamedList();
//disabled for MCR-953 and https://issues.apache.org/jira/browse/SOLR-7508
//Map<String, String[]> parameters = ModifiableSolrParams.toMultiMap(namedList);
HashMap<String, String[]> parameters = new HashMap<>();
for (int i = 0; i < namedList.size(); i++) {
String name = namedList.getName(i);
Object val = namedList.getVal(i);
if (val instanceof String[]) {
MultiMapSolrParams.addParam(name, (String[]) val, parameters);
} else {
MultiMapSolrParams.addParam(name, val.toString(), parameters);
}
}
//end of fix
return parameters;
}
示例3: Tag
import org.apache.solr.common.util.NamedList; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
Tag(NamedList<Object> res){
for( int i=0; i<res.size(); i++ ) {
String n = res.getName( i );
switch (n) {
case "startOffset":
_start = (Integer)res.getVal(i);
break;
case "endOffset":
_end = (Integer)res.getVal(i);
break;
case "ids":
_ids = (List<Object>)res.getVal(i);
break;
default:
break;
}
}
}
示例4: updateExternalRepresentation
import org.apache.solr.common.util.NamedList; //導入方法依賴的package包/類
@Override
public void updateExternalRepresentation(NamedList<Object> nl) {
for (int i = 0; i < nl.size(); i++) {
String rawName = nl.getName(i);
String externalName = readableToExternal(rawName);
nl.setName(i, externalName);
Object val = nl.getVal(i);
Object updatedVal;
if (!(val instanceof Number) && (updatedVal = updateValueExternalRepresentation(val)) != null) {
nl.setVal(i, updatedVal);
}
}
}
示例5: QuerySegmenterConfig
import org.apache.solr.common.util.NamedList; //導入方法依賴的package包/類
@SuppressWarnings("rawtypes")
public QuerySegmenterConfig(NamedList args) {
segmenter = new QuerySegmenterDefaultImpl();
NamedList segments = (NamedList) args.get(INIT_ATTR_SEGMENTS);
for (int i = 0; i < segments.size(); i++) {
String name = segments.getName(i);
NamedList values = (NamedList) segments.getVal(i);
initSegmentType(name, values);
}
}