ArangoSearch Examples

    A View with default parameters can be created by calling (see ):

    1. v0 = db._createView("ExampleView", "arangosearch", {});

    You have to wait a few seconds for the View to update its index.Then you can query it:

    1. SEARCH PHRASE(doc.text, "型数 据库", "text_zh") OR
    2. ANALYZER(STARTS_WITH(doc.b, "ba"), "text_en")
    3. SORT TFIDF(doc) DESC
    4. RETURN doc`);

    Use cases

    The data contained in our View looks like that:

    1. { "id": 2, "body": "ThisIsNotSoLong" }
    2. { "id": 3, "body": "ThisIsShorter" }
    3. { "id": 5, "body": "ButNotThis" }

    It will find the documents with the ids 1, 2, 3, , but not 5.