本文整理汇总了Java中org.elasticsearch.common.xcontent.XContentHelper.update方法的典型用法代码示例。如果您正苦于以下问题:Java XContentHelper.update方法的具体用法?Java XContentHelper.update怎么用?Java XContentHelper.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.xcontent.XContentHelper
的用法示例。
在下文中一共展示了XContentHelper.update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.elasticsearch.common.xcontent.XContentHelper; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void write(Row row) {
for (CollectExpression<Row, ?> collectExpression : collectExpressions) {
collectExpression.setNextRow(row);
}
Map doc = (Map) row.get(0);
XContentHelper.update(doc, overwrites, false);
try {
builder.map(doc);
builder.flush();
outputStream.write(NEW_LINE);
} catch (IOException e) {
throw new UnhandledServerException("Failed to write row to output", e);
}
}
示例2: merge
import org.elasticsearch.common.xcontent.XContentHelper; //导入方法依赖的package包/类
protected DocIndexMetaData merge(DocIndexMetaData other,
TransportPutIndexTemplateAction transportPutIndexTemplateAction,
boolean thisIsCreatedFromTemplate) throws IOException {
if (schemaEquals(other)) {
return this;
} else if (thisIsCreatedFromTemplate) {
if (this.references.size() < other.references.size()) {
// this is older, update template and return other
// settings in template are always authoritative for table information about
// number_of_shards and number_of_replicas
updateTemplate(other, transportPutIndexTemplateAction, this.metaData.getSettings());
// merge the new mapping with the template settings
return new DocIndexMetaData(
functions,
IndexMetaData.builder(other.metaData).settings(this.metaData.getSettings()).build(),
other.ident).build();
} else if (references().size() == other.references().size() &&
!references().keySet().equals(other.references().keySet())) {
XContentHelper.update(defaultMappingMap, other.defaultMappingMap, false);
// update the template with new information
updateTemplate(this, transportPutIndexTemplateAction, this.metaData.getSettings());
return this;
}
// other is older, just return this
return this;
} else {
throw new TableAliasSchemaException(other.ident.name());
}
}