arangosh> db.example.ensureIndex({ type: "fulltext", fields: [ "text" ], minLength: 3 });
{
"fields" : [
"text"
],
"id" : "example/18412",
"isNewlyCreated" : true,
"minLength" : 3,
"sparse" : true,
"type" : "fulltext",
"unique" : false,
"code" : 201
}
arangosh> db.example.save({ text : "the quick brown", b : { c : 1 } });
{
"_id" : "example/18415",
"_key" : "18415",
"_rev" : "_XGh_XzW--_"
}
arangosh> db.example.save({ text : "quick brown fox", b : { c : 2 } });
{
"_id" : "example/18419",
"_key" : "18419",
"_rev" : "_XGh_Xza--_"
}
arangosh> db.example.save({ text : "brown fox jums", b : { c : 3 } });
{
"_id" : "example/18422",
"_key" : "18422",
"_rev" : "_XGh_Xze--_"
}
arangosh> db.example.save({ text : "fox jumps over", b : { c : 4 } });
{
"_id" : "example/18425",
"_key" : "18425",
"_rev" : "_XGh_Xze--B"
}
arangosh> db.example.save({ text : "jumps over the", b : { c : 5 } });
{
"_id" : "example/18428",
"_key" : "18428",
"_rev" : "_XGh_Xzi--_"
}
arangosh> db.example.save({ text : "over the lazy", b : { c : 6 } });
{
"_id" : "example/18431",
"_key" : "18431",
"_rev" : "_XGh_Xzm--_"
}
arangosh> db.example.save({ text : "the lazy dog", b : { c : 7 } });
{
"_id" : "example/18434",
"_key" : "18434",
"_rev" : "_XGh_Xzq--_"
}
arangosh> db._query("FOR document IN FULLTEXT(example, 'text', 'the') RETURN document");
[
{
"_key" : "18415",
"_id" : "example/18415",
"_rev" : "_XGh_XzW--_",
"text" : "the quick brown",
"b" : {
"c" : 1
}
},
{
"_key" : "18428",
"_id" : "example/18428",
"_rev" : "_XGh_Xzi--_",
"text" : "jumps over the",
"b" : {
"c" : 5
}
},
{
"_key" : "18431",
"_id" : "example/18431",
"_rev" : "_XGh_Xzm--_",
"text" : "over the lazy",
"b" : {
"c" : 6
}
},
{
"_key" : "18434",
"_id" : "example/18434",
"_rev" : "_XGh_Xzq--_",
"text" : "the lazy dog",
"b" : {
"c" : 7
}
}
]
[object ArangoQueryCursor, count: 4, cached: false, hasMore: false]