ArangoSearch Examples
A View with default parameters can be created by calling (see ):
v0 = db._createView("ExampleView", "arangosearch", {});
You have to wait a few seconds for the View to update its index.Then you can query it:
SEARCH PHRASE(doc.text, "型数 据库", "text_zh") OR
ANALYZER(STARTS_WITH(doc.b, "ba"), "text_en")
SORT TFIDF(doc) DESC
RETURN doc`);
Use cases
The data contained in our View looks like that:
{ "id": 2, "body": "ThisIsNotSoLong" }
{ "id": 3, "body": "ThisIsShorter" }
{ "id": 5, "body": "ButNotThis" }
It will find the documents with the ids 1
, 2
, 3
, , but not 5
.