arangosh> db.example.ensureIndex({ type: "fulltext", fields: [ "text" ], minLength: 3 });
{
"fields" : [
"text"
],
"id" : "example/17875",
"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/17878",
"_key" : "17878",
"_rev" : "_WBDpCwq--_"
}
arangosh> db.example.save({ text : "quick brown fox", b : { c : 2 } });
{
"_id" : "example/17882",
"_key" : "17882",
"_rev" : "_WBDpCwu--_"
}
arangosh> db.example.save({ text : "brown fox jums", b : { c : 3 } });
{
"_id" : "example/17885",
"_key" : "17885",
"_rev" : "_WBDpCwu--B"
}
arangosh> db.example.save({ text : "fox jumps over", b : { c : 4 } });
{
"_id" : "example/17888",
"_key" : "17888",
"_rev" : "_WBDpCwy--_"
}
arangosh> db.example.save({ text : "jumps over the", b : { c : 5 } });
{
"_id" : "example/17891",
"_key" : "17891",
"_rev" : "_WBDpCw2--_"
}
arangosh> db.example.save({ text : "over the lazy", b : { c : 6 } });
{
"_id" : "example/17894",
"_key" : "17894",
"_rev" : "_WBDpCw6--_"
}
arangosh> db.example.save({ text : "the lazy dog", b : { c : 7 } });
{
"_id" : "example/17897",
"_key" : "17897",
"_rev" : "_WBDpCw6--B"
}
arangosh> db._query("FOR document IN FULLTEXT(example, 'text', 'the') RETURN document");
[
{
"_key" : "17878",
"_id" : "example/17878",
"_rev" : "_WBDpCwq--_",
"text" : "the quick brown",
"b" : {
"c" : 1
}
},
{
"_key" : "17891",
"_id" : "example/17891",
"_rev" : "_WBDpCw2--_",
"text" : "jumps over the",
"b" : {
"c" : 5
}
},
{
"_key" : "17894",
"_id" : "example/17894",
"_rev" : "_WBDpCw6--_",
"text" : "over the lazy",
"b" : {
"c" : 6
}
},
{
"_key" : "17897",
"_id" : "example/17897",
"_rev" : "_WBDpCw6--B",
"text" : "the lazy dog",
"b" : {
"c" : 7
}
}
]
[object ArangoQueryCursor, count: 4, cached: false, hasMore: false]