0
votes

I have events collection inserted with a below record in ARANGODB. ( I am new to 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)

1

1 Answers

1
votes

Unlike SQL, AQL is a language used for data selection and data manipulation. It is not a data definition language, so you can't use AQL to create indexes.

In order to create an index, please use ArangoDB's web interface (Collections => target collection => Indexes => "+" icon) or the ArangoShell. The ArangoShell is a separate executable that is shipped with all ArangoDB packages.

In the ArangoShell you can use the command

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

to create the index.