arangosh> db.example.ensureIndex({ type: "fulltext", fields: [ "text" ], minLength: 3 });
{
"fields" : [
"text"
],
"id" : "example/110938",
"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/110941",
"_key" : "110941",
"_rev" : "_YOn1fxq--_"
}
arangosh> db.example.save({ text : "quick brown fox", b : { c : 2 } });
{
"_id" : "example/110945",
"_key" : "110945",
"_rev" : "_YOn1fxq--B"
}
arangosh> db.example.save({ text : "brown fox jums", b : { c : 3 } });
{
"_id" : "example/110948",
"_key" : "110948",
"_rev" : "_YOn1fxu--_"
}
arangosh> db.example.save({ text : "fox jumps over", b : { c : 4 } });
{
"_id" : "example/110951",
"_key" : "110951",
"_rev" : "_YOn1fxu--B"
}
arangosh> db.example.save({ text : "jumps over the", b : { c : 5 } });
{
"_id" : "example/110954",
"_key" : "110954",
"_rev" : "_YOn1fxu--D"
}
arangosh> db.example.save({ text : "over the lazy", b : { c : 6 } });
{
"_id" : "example/110957",
"_key" : "110957",
"_rev" : "_YOn1fxy--_"
}
arangosh> db.example.save({ text : "the lazy dog", b : { c : 7 } });
{
"_id" : "example/110960",
"_key" : "110960",
"_rev" : "_YOn1fxy--B"
}
arangosh> db._query("FOR document IN FULLTEXT(example, 'text', 'the') RETURN document");
[
{
"_key" : "110941",
"_id" : "example/110941",
"_rev" : "_YOn1fxq--_",
"text" : "the quick brown",
"b" : {
"c" : 1
}
},
{
"_key" : "110954",
"_id" : "example/110954",
"_rev" : "_YOn1fxu--D",
"text" : "jumps over the",
"b" : {
"c" : 5
}
},
{
"_key" : "110957",
"_id" : "example/110957",
"_rev" : "_YOn1fxy--_",
"text" : "over the lazy",
"b" : {
"c" : 6
}
},
{
"_key" : "110960",
"_id" : "example/110960",
"_rev" : "_YOn1fxy--B",
"text" : "the lazy dog",
"b" : {
"c" : 7
}
}
]
[object ArangoQueryCursor, count: 4, cached: false, hasMore: false]