arangosh> db.example.ensureIndex({ type: "fulltext", fields: [ "text" ], minLength: 3 });
{
"fields" : [
"text"
],
"id" : "example/15230",
"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/15233",
"_key" : "15233",
"_rev" : "_VRerBIm---"
}
arangosh> db.example.save({ text : "quick brown fox", b : { c : 2 } });
{
"_id" : "example/15237",
"_key" : "15237",
"_rev" : "_VRerBIm--_"
}
arangosh> db.example.save({ text : "brown fox jums", b : { c : 3 } });
{
"_id" : "example/15240",
"_key" : "15240",
"_rev" : "_VRerBIq---"
}
arangosh> db.example.save({ text : "fox jumps over", b : { c : 4 } });
{
"_id" : "example/15243",
"_key" : "15243",
"_rev" : "_VRerBIq--_"
}
arangosh> db.example.save({ text : "jumps over the", b : { c : 5 } });
{
"_id" : "example/15246",
"_key" : "15246",
"_rev" : "_VRerBIq--A"
}
arangosh> db.example.save({ text : "over the lazy", b : { c : 6 } });
{
"_id" : "example/15249",
"_key" : "15249",
"_rev" : "_VRerBIu---"
}
arangosh> db.example.save({ text : "the lazy dog", b : { c : 7 } });
{
"_id" : "example/15252",
"_key" : "15252",
"_rev" : "_VRerBIu--_"
}
arangosh> db._query("FOR document IN FULLTEXT(example, 'text', 'the') RETURN document");
[
{
"_key" : "15233",
"_id" : "example/15233",
"_rev" : "_VRerBIm---",
"text" : "the quick brown",
"b" : {
"c" : 1
}
},
{
"_key" : "15246",
"_id" : "example/15246",
"_rev" : "_VRerBIq--A",
"text" : "jumps over the",
"b" : {
"c" : 5
}
},
{
"_key" : "15249",
"_id" : "example/15249",
"_rev" : "_VRerBIu---",
"text" : "over the lazy",
"b" : {
"c" : 6
}
},
{
"_key" : "15252",
"_id" : "example/15252",
"_rev" : "_VRerBIu--_",
"text" : "the lazy dog",
"b" : {
"c" : 7
}
}
]
[object ArangoQueryCursor, count: 4, cached: false, hasMore: false]