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


Java StringFieldMapper.merge方法代码示例

本文整理汇总了Java中org.elasticsearch.index.mapper.core.StringFieldMapper.merge方法的典型用法代码示例。如果您正苦于以下问题:Java StringFieldMapper.merge方法的具体用法?Java StringFieldMapper.merge怎么用?Java StringFieldMapper.merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.index.mapper.core.StringFieldMapper的用法示例。


在下文中一共展示了StringFieldMapper.merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doMerge

import org.elasticsearch.index.mapper.core.StringFieldMapper; //导入方法依赖的package包/类
@Override
public void doMerge(Mapper mergeWith, boolean includeInAll) throws MergeMappingException {
	super.doMerge(mergeWith, includeInAll);

	OntologyMapper oMergeWith = (OntologyMapper) mergeWith;
	OntologySettings mergeSettings = oMergeWith.ontologySettings;
	if (mergeSettings.getOntologyUri() != null && !mergeSettings.getOntologyUri().equals(ontologySettings.getOntologyUri())) {
		throw new IllegalArgumentException("mapper [" + fieldType().names().fullName() + "] has different ontology URI");
	} else if (mergeSettings.getOlsBaseUrl() != null && !mergeSettings.getOlsBaseUrl().equals(ontologySettings.getOlsBaseUrl())) {
		throw new IllegalArgumentException("mapper [" + fieldType().names().fullName() + "] has different OLS base URL");
	}

	// Merge the mappers
	List<FieldMapper> newFieldMappers = null;
	Map<String, StringFieldMapper> newMapperMap = null;

	for (Entry<String, StringFieldMapper> entry : oMergeWith.mappers.entrySet()) {
		StringFieldMapper mergeIntoMapper = mappers.get(entry.getKey());
		if (mergeIntoMapper == null) {
			if (newFieldMappers == null) {
				newFieldMappers = new ArrayList<>(oMergeWith.mappers.size());
				newMapperMap = new HashMap<>();
			}
			newFieldMappers.add(entry.getValue());
			newMapperMap.put(entry.getKey(), entry.getValue());
		} else {
			mergeIntoMapper.merge(entry.getValue(), includeInAll);
		}
	}

	if (newFieldMappers != null) {
		mappers = mappers.copyAndPutAll(newMapperMap);
	}
}
 
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:35,代码来源:OntologyMapper.java

示例2: merge

import org.elasticsearch.index.mapper.core.StringFieldMapper; //导入方法依赖的package包/类
@Override
public void merge(Mapper mergeWith, MergeResult mergeResult) throws MergeMappingException {
	super.merge(mergeWith, mergeResult);
	if (!this.getClass().equals(mergeWith.getClass())) {
		return;
	}

	OntologyMapper oMergeWith = (OntologyMapper) mergeWith;
	OntologySettings mergeSettings = oMergeWith.ontologySettings;
	if (mergeSettings.getOntologyUri() != null && !mergeSettings.getOntologyUri().equals(ontologySettings.getOntologyUri())) {
		mergeResult.addConflict("mapper [" + fieldType().names().fullName() + "] has different ontology URI");
	} else if (mergeSettings.getOlsBaseUrl() != null && !mergeSettings.getOlsBaseUrl().equals(ontologySettings.getOlsBaseUrl())) {
		mergeResult.addConflict("mapper [" + fieldType().names().fullName() + "] has different OLS base URL");
	}

	// Not sure if the below is necessary or not...
	if (!mergeResult.simulate() && !mergeResult.hasConflicts()) {
		// Merge the mappers
		List<FieldMapper> newFieldMappers = null;
		Map<String, StringFieldMapper> newMapperMap = null;

		for (Entry<String, StringFieldMapper> entry : oMergeWith.mappers.entrySet()) {
			StringFieldMapper mergeIntoMapper = mappers.get(entry.getKey());
			if (mergeIntoMapper == null) {
				if (newFieldMappers == null) {
					newFieldMappers = new ArrayList<>(oMergeWith.mappers.size());
					newMapperMap = new HashMap<>();
				}
				newFieldMappers.add(entry.getValue());
				newMapperMap.put(entry.getKey(), entry.getValue());
			} else {
				mergeIntoMapper.merge(entry.getValue(), mergeResult);
			}
		}

		if (newFieldMappers != null) {
			mergeResult.addFieldMappers(newFieldMappers);
			mappers = mappers.copyAndPutAll(newMapperMap);
		}
	}
}
 
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:42,代码来源:OntologyMapper.java

示例3: merge

import org.elasticsearch.index.mapper.core.StringFieldMapper; //导入方法依赖的package包/类
@Override
public void merge(Mapper mergeWith, MergeResult mergeResult) throws MergeMappingException {
	super.merge(mergeWith, mergeResult);
	if (!this.getClass().equals(mergeWith.getClass())) {
		return;
	}

	OntologyMapper oMergeWith = (OntologyMapper)mergeWith;
	OntologySettings mergeSettings = oMergeWith.ontologySettings;
	if (mergeSettings.getOntologyUri() != null && !mergeSettings.getOntologyUri().equals(ontologySettings.getOntologyUri())) {
		mergeResult.addConflict("mapper [" + fieldType().names().fullName() + "] has different ontology URI");
	} else if (mergeSettings.getOlsBaseUrl() != null && !mergeSettings.getOlsBaseUrl().equals(ontologySettings.getOlsBaseUrl())) {
		mergeResult.addConflict("mapper [" + fieldType().names().fullName() + "] has different OLS base URL");
	}

	// Not sure if the below is necessary or not...
	if (!mergeResult.simulate() && !mergeResult.hasConflicts()) {
		// Merge the mappers
		List<FieldMapper> newFieldMappers = null;
		Map<String, StringFieldMapper> newMapperMap = null;

		for (Entry<String, StringFieldMapper> entry : oMergeWith.mappers.entrySet()) {
			StringFieldMapper mergeIntoMapper = mappers.get(entry.getKey());
			if (mergeIntoMapper == null) {
				if (newFieldMappers == null) {
					newFieldMappers = new ArrayList<>(oMergeWith.mappers.size());
					newMapperMap = new HashMap<>();
				}
				newFieldMappers.add(entry.getValue());
				newMapperMap.put(entry.getKey(), entry.getValue());
			} else {
				mergeIntoMapper.merge(entry.getValue(), mergeResult);
			}
		}

		if (newFieldMappers != null) {
			mergeResult.addFieldMappers(newFieldMappers);
			mappers = mappers.copyAndPutAll(newMapperMap);
		}
	}
}
 
开发者ID:flaxsearch,项目名称:BioSolr,代码行数:42,代码来源:OntologyMapper.java


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