本文整理匯總了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());
}
}