简体   繁体   English

ARANGODB ensureIndex 无法创建全文

[英]ARANGODB ensureIndex to create full text not working

I have events collection inserted with a below record in ARANGODB.我在 ARANGODB 中插入了以下记录的事件集合。 ( I am new to Arango ) (我是 Arango 的新手)

INSERT {
    "source": "ABC",
    "target": "ZYX",
    "tranno": "ABCDEF",
    "type": "REST",
    "attributes" : { "myID" : "12345"}
} INTO events

But trying to create full text index on attributes, resulting in error as given below.但是尝试在属性上创建全文索引,导致错误如下。 It would be great if you could help with this.如果您能对此提供帮助,那就太好了。

events.createIndex ({ type: "fulltext", fields: [ "attributes" ], minLength: 3 })

Query: AQL: syntax error, unexpected identifier near 'events.createIndex ({ type: "ful...' at position 1:1 (while parsing)查询:AQL:语法错误,'events.createIndex 附近的意外标识符({ type: "ful..." at position 1:1 (while parsing)

Unlike SQL, AQL is a language used for data selection and data manipulation.与 SQL 不同,AQL 是一种用于数据选择和数据操作的语言。 It is not a data definition language, so you can't use AQL to create indexes.它不是一种数据定义语言,因此您不能使用 AQL 创建索引。

In order to create an index, please use ArangoDB's web interface (Collections => target collection => Indexes => "+" icon) or the ArangoShell.为了创建索引,请使用 ArangoDB 的 Web 界面(集合 => 目标集合 => 索引 => "+" 图标)或 ArangoShell。 The ArangoShell is a separate executable that is shipped with all ArangoDB packages. ArangoShell 是一个单独的可执行文件,随所有 ArangoDB 包一起提供。

In the ArangoShell you can use the command在 ArangoShell 中,您可以使用命令

db.events.createIndex ({ type: "fulltext", fields: [ "attributes" ], minLength: 3 })

to create the index.创建索引。

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

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