How can I create a search query in c# to match exact word that I specify. For eg lets say my dataset is in the following way:
{_id: 1, "name": "Hello World"}
{_id: 2, "name": "Hello"}
{_id: 3, "name": "Tree and grass"}
{_id: 4, "name": "Cat and Dog"}
{_id: 5, "name": "and"}
var filter = Builders<MyClass>.Search.Text(x => x.Name, new List<string> { "Hello", "and" });
var result = _collection.Aggregate().Search(filter, indexName: "WordIdx").ToList();
The result here will contain all the elements that is
{_id: 1, "name": "Hello World"}
{_id: 2, "name": "Hello"}
{_id: 3, "name": "Tree and grass"}
{_id: 4, "name": "Cat and Dog"}
{_id: 5, "name": "and"}
But I only want {_id: 2, “name”: “Hello”} and {_id: 5, “name”: “and”}.
Should I use _collection.Aggregate().Search(filter, indexName: “WordIdx”).Limit(2).ToList()? But I am worried about my results being inaccurate