简体   繁体   English

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

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

I'm working with some document trying to implement the TF-IDF method to search similarities over documents. 我正在处理一些文档,试图实现TF-IDF方法来搜索文档之间的相似性。 At one point, I need to calculate the Term Frequency (TF). 一方面,我需要计算术语频率(TF)。 I have two vertex in this realation: Documento ---> DocWord 在这个实现中,我有两个顶点:Documento ---> DocWord

DocWord vertex has the following fields: int frequence double tf double idf DocWord顶点具有以下字段:int频率double tf double idf

Documento has: int wordCount Documento具有:int wordCount

I need to update all DocWord tf field with: frequence/Documento.wordCount 我需要使用以下命令更新所有DocWord tf字段:frequence / Documento.wordCount

The query I'm trying to run is: 我正在尝试运行的查询是:

update DocWord set tf = frequence/in("Documento_docwords").wordCount[0]; 更新DocWord设置tf =频率/in("Documento_docwords").wordCount[0];

but this fail. 但这失败了。

尝试:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM