本文整理汇总了Java中org.apache.solr.common.util.SimpleOrderedMap.getName方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleOrderedMap.getName方法的具体用法?Java SimpleOrderedMap.getName怎么用?Java SimpleOrderedMap.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.common.util.SimpleOrderedMap
的用法示例。
在下文中一共展示了SimpleOrderedMap.getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeFieldTypes
import org.apache.solr.common.util.SimpleOrderedMap; //导入方法依赖的package包/类
private void writeFieldTypes(List<SimpleOrderedMap<Object>> fieldTypePropertiesList) throws IOException {
for (SimpleOrderedMap<Object> fieldTypeProperties : fieldTypePropertiesList) {
SimpleOrderedMap<Object> analyzerProperties = null;
SimpleOrderedMap<Object> indexAnalyzerProperties = null;
SimpleOrderedMap<Object> queryAnalyzerProperties = null;
SimpleOrderedMap<Object> multiTermAnalyzerProperties = null;
SimpleOrderedMap<Object> perFieldSimilarityProperties = null;
openStartTag(IndexSchema.FIELD_TYPE);
for (int fieldTypePropNum = 0 ; fieldTypePropNum < fieldTypeProperties.size() ; ++fieldTypePropNum) {
String fieldTypePropName = fieldTypeProperties.getName(fieldTypePropNum);
if (fieldTypePropName.equals(FieldType.ANALYZER)) {
analyzerProperties = (SimpleOrderedMap<Object>)fieldTypeProperties.getVal(fieldTypePropNum);
} else if (fieldTypePropName.equals(FieldType.INDEX_ANALYZER)) {
indexAnalyzerProperties = (SimpleOrderedMap<Object>)fieldTypeProperties.getVal(fieldTypePropNum);
} else if (fieldTypePropName.equals(FieldType.QUERY_ANALYZER)) {
queryAnalyzerProperties = (SimpleOrderedMap<Object>)fieldTypeProperties.getVal(fieldTypePropNum);
} else if (fieldTypePropName.equals(FieldType.MULTI_TERM_ANALYZER)) {
multiTermAnalyzerProperties = (SimpleOrderedMap<Object>)fieldTypeProperties.getVal(fieldTypePropNum);
} else if (fieldTypePropName.equals(FieldType.SIMILARITY)) {
perFieldSimilarityProperties = (SimpleOrderedMap<Object>)fieldTypeProperties.getVal(fieldTypePropNum);
} else {
writeAttr(fieldTypePropName, fieldTypeProperties.getVal(fieldTypePropNum).toString());
}
}
boolean isEmptyTag = null == analyzerProperties && null == indexAnalyzerProperties
&& null == queryAnalyzerProperties && null == multiTermAnalyzerProperties
&& null == perFieldSimilarityProperties;
if (isEmptyTag) {
closeStartTag(true);
} else {
closeStartTag(false);
incLevel();
if (null != analyzerProperties) writeAnalyzer(analyzerProperties, null);
if (null != indexAnalyzerProperties) writeAnalyzer(indexAnalyzerProperties, FieldType.INDEX);
if (null != queryAnalyzerProperties) writeAnalyzer(queryAnalyzerProperties, FieldType.QUERY);
if (null != multiTermAnalyzerProperties) writeAnalyzer(multiTermAnalyzerProperties, FieldType.MULTI_TERM);
if (null != perFieldSimilarityProperties) writeSimilarity(perFieldSimilarityProperties);
decLevel();
endTag(IndexSchema.FIELD_TYPE);
}
}
}
示例2: writeAnalyzer
import org.apache.solr.common.util.SimpleOrderedMap; //导入方法依赖的package包/类
private void writeAnalyzer(SimpleOrderedMap<Object> analyzerProperties, String analyzerType) throws IOException {
openStartTag(FieldType.ANALYZER);
if (null != analyzerType) {
writeAttr(FieldType.TYPE, analyzerType);
}
List<SimpleOrderedMap<Object>> charFilterPropertiesList = null;
SimpleOrderedMap<Object> tokenizerProperties = null;
List<SimpleOrderedMap<Object>> filterPropertiesList = null;
for (int i = 0 ; i < analyzerProperties.size() ; ++i) {
String name = analyzerProperties.getName(i);
if (name.equals(FieldType.CHAR_FILTERS)) {
charFilterPropertiesList = (List<SimpleOrderedMap<Object>>)analyzerProperties.getVal(i);
} else if (name.equals(FieldType.TOKENIZER)) {
tokenizerProperties = (SimpleOrderedMap<Object>)analyzerProperties.getVal(i);
} else if (name.equals(FieldType.FILTERS)) {
filterPropertiesList = (List<SimpleOrderedMap<Object>>)analyzerProperties.getVal(i);
} else if (name.equals(FieldType.CLASS_NAME)) {
if ( ! "solr.TokenizerChain".equals(analyzerProperties.getVal(i))) {
writeAttr(name, analyzerProperties.getVal(i).toString());
}
}
}
boolean isEmptyTag
= null == charFilterPropertiesList && null == tokenizerProperties && null == filterPropertiesList;
if (isEmptyTag) {
closeStartTag(true);
} else {
closeStartTag(false);
incLevel();
if (null != charFilterPropertiesList) {
for (SimpleOrderedMap<Object> charFilterProperties : charFilterPropertiesList) {
openStartTag(FieldType.CHAR_FILTER);
for (int i = 0 ; i < charFilterProperties.size() ; ++i) {
writeAttr(charFilterProperties.getName(i), charFilterProperties.getVal(i).toString());
}
closeStartTag(true);
}
}
if (null != tokenizerProperties) {
openStartTag(FieldType.TOKENIZER);
for (int i = 0 ; i < tokenizerProperties.size() ; ++i) {
writeAttr(tokenizerProperties.getName(i), tokenizerProperties.getVal(i).toString());
}
closeStartTag(true);
}
if (null != filterPropertiesList) {
for (SimpleOrderedMap<Object> filterProperties : filterPropertiesList) {
openStartTag(FieldType.FILTER);
for (int i = 0 ; i < filterProperties.size() ; ++i) {
writeAttr(filterProperties.getName(i), filterProperties.getVal(i).toString());
}
closeStartTag(true);
}
}
decLevel();
endTag(FieldType.ANALYZER);
}
}