arangosh> db.example.ensureIndex({ type: "fulltext", fields: [ "text" ], minLength: 3 });
{
"fields" : [
"text"
],
"id" : "example/110077",
"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/110080",
"_key" : "110080",
"_rev" : "_XUJzKjK--_"
}
arangosh> db.example.save({ text : "quick brown fox", b : { c : 2 } });
{
"_id" : "example/110084",
"_key" : "110084",
"_rev" : "_XUJzKjO--_"
}
arangosh> db.example.save({ text : "brown fox jums", b : { c : 3 } });
{
"_id" : "example/110087",
"_key" : "110087",
"_rev" : "_XUJzKjS--_"
}
arangosh> db.example.save({ text : "fox jumps over", b : { c : 4 } });
{
"_id" : "example/110090",
"_key" : "110090",
"_rev" : "_XUJzKjS--B"
}
arangosh> db.example.save({ text : "jumps over the", b : { c : 5 } });
{
"_id" : "example/110093",
"_key" : "110093",
"_rev" : "_XUJzKjW--_"
}
arangosh> db.example.save({ text : "over the lazy", b : { c : 6 } });
{
"_id" : "example/110096",
"_key" : "110096",
"_rev" : "_XUJzKjW--B"
}
arangosh> db.example.save({ text : "the lazy dog", b : { c : 7 } });
{
"_id" : "example/110099",
"_key" : "110099",
"_rev" : "_XUJzKja--_"
}
arangosh> db._query("FOR document IN FULLTEXT(example, 'text', 'the') RETURN document");
[
{
"_key" : "110080",
"_id" : "example/110080",
"_rev" : "_XUJzKjK--_",
"text" : "the quick brown",
"b" : {
"c" : 1
}
},
{
"_key" : "110093",
"_id" : "example/110093",
"_rev" : "_XUJzKjW--_",
"text" : "jumps over the",
"b" : {
"c" : 5
}
},
{
"_key" : "110096",
"_id" : "example/110096",
"_rev" : "_XUJzKjW--B",
"text" : "over the lazy",
"b" : {
"c" : 6
}
},
{
"_key" : "110099",
"_id" : "example/110099",
"_rev" : "_XUJzKja--_",
"text" : "the lazy dog",
"b" : {
"c" : 7
}
}
]
[object ArangoQueryCursor, count: 4, cached: false, hasMore: false]