OrientDB:如何使用来自其他顶点的数据更新字段

OrientDB: how to update a field with data from other vertex

我正在处理一些文档,试图实施 TF-IDF 方法来搜索文档的相似性。 有一次,我需要计算词频 (TF)。 我在这个现实中有两个顶点: 文档 ---> DocWord

DocWord 顶点具有以下字段: 整数频率 双 tf 双 idf

Documento 有: int 字数

我需要更新所有 DocWord tf 字段: frequence/Documento.wordCount

我正在尝试 运行 的查询是:

更新 DocWord 集 tf = frequence/in("Documento_docwords").wordCount[0];

但这失败了。

试试:

update DocWord set tf = (frequence / in("Documento_docwords").wordCount[0])