1
0
Fork 0
arangodb/Documentation/Examples/collectionFulltext.generated

47 lines
1.1 KiB
Plaintext

arangosh> db.emails.ensureFulltextIndex("content");
{
"id" : "emails/1133245323",
"type" : "fulltext",
"fields" : [
"content"
],
"unique" : false,
"sparse" : true,
"minLength" : 2,
"isNewlyCreated" : true,
"code" : 201
}
arangosh> db.emails.save({ content: "Hello Alice, how are you doing? Regards, Bob" });
{
"_id" : "emails/1133573003",
"_rev" : "1133573003",
"_key" : "1133573003"
}
arangosh> db.emails.save({ content: "Hello Charlie, do Alice and Bob know about it?" });
{
"_id" : "emails/1133769611",
"_rev" : "1133769611",
"_key" : "1133769611"
}
arangosh> db.emails.save({ content: "I think they don't know. Regards, Eve" });
{
"_id" : "emails/1133966219",
"_rev" : "1133966219",
"_key" : "1133966219"
}
arangosh> db.emails.fulltext("content", "charlie,|eve").toArray();
[
{
"_id" : "emails/1133769611",
"_key" : "1133769611",
"_rev" : "1133769611",
"content" : "Hello Charlie, do Alice and Bob know about it?"
},
{
"_id" : "emails/1133966219",
"_key" : "1133966219",
"_rev" : "1133966219",
"content" : "I think they don't know. Regards, Eve"
}
]