arangosh> db.example.ensureIndex({ type: "fulltext", fields: [ "text" ], minLength: 3 });
{
"fields" : [
"text"
],
"id" : "example/111329",
"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/111332",
"_key" : "111332",
"_rev" : "_Y2g68n---_"
}
arangosh> db.example.save({ text : "quick brown fox", b : { c : 2 } });
{
"_id" : "example/111336",
"_key" : "111336",
"_rev" : "_Y2g68nC--_"
}
arangosh> db.example.save({ text : "brown fox jums", b : { c : 3 } });
{
"_id" : "example/111339",
"_key" : "111339",
"_rev" : "_Y2g68nC--B"
}
arangosh> db.example.save({ text : "fox jumps over", b : { c : 4 } });
{
"_id" : "example/111342",
"_key" : "111342",
"_rev" : "_Y2g68nG--_"
}
arangosh> db.example.save({ text : "jumps over the", b : { c : 5 } });
{
"_id" : "example/111345",
"_key" : "111345",
"_rev" : "_Y2g68nG--B"
}
arangosh> db.example.save({ text : "over the lazy", b : { c : 6 } });
{
"_id" : "example/111348",
"_key" : "111348",
"_rev" : "_Y2g68nK--_"
}
arangosh> db.example.save({ text : "the lazy dog", b : { c : 7 } });
{
"_id" : "example/111351",
"_key" : "111351",
"_rev" : "_Y2g68nK--B"
}
arangosh> db._query("FOR document IN FULLTEXT(example, 'text', 'the') RETURN document");
[
{
"_key" : "111332",
"_id" : "example/111332",
"_rev" : "_Y2g68n---_",
"text" : "the quick brown",
"b" : {
"c" : 1
}
},
{
"_key" : "111345",
"_id" : "example/111345",
"_rev" : "_Y2g68nG--B",
"text" : "jumps over the",
"b" : {
"c" : 5
}
},
{
"_key" : "111348",
"_id" : "example/111348",
"_rev" : "_Y2g68nK--_",
"text" : "over the lazy",
"b" : {
"c" : 6
}
},
{
"_key" : "111351",
"_id" : "example/111351",
"_rev" : "_Y2g68nK--B",
"text" : "the lazy dog",
"b" : {
"c" : 7
}
}
]
[object ArangoQueryCursor, count: 4, cached: false, hasMore: false]