Closed ghendo closed 2 years ago
If you're trying to searching for "John"
in any field, then what you need is a wildcard search path. This is not yet supported in Beta 1, but the change adding support for it was recently committed and will be included in Beta 2. Once it's released, you'll want to do something along the lines of the following:
Collection.Aggregate()
.Search(
SearchBuilders.Search
.Phrase(
"John",
SearchBuilders.Path
.Wildcard("*")))
.ToList()
Beta 2 has now been released: https://www.nuget.org/packages/MongoDB.Labs.Search/1.0.0-beta2
You should be able to gain access to the feature that you've requested by upgrading to the new version.
I got an error as conflict with version of mongodb.driver
What versions are you using? There were some changes to interfaces used by the Atlas Search extension in version 2.14 of the driver, so you'll need to upgrade if you're using an earlier version.
Its ok now. I uninstalled both this and the driver and reinstalled and now works
I want to do a wildcard search and tried Collection.Aggregate() .Search( SearchBuilders.Search
.Wildcard("John","*",true))
.ToList();
which did not return anything Any chance for a bit of help?