NOT LIKE query in NEST
I've written a NEST query that matches documents that have words in a string ("queryString" below). I want to filter out documents that contain the word "not". I've tried the boolean query but it doesn't filter out the documents. What am I doing wrong here? var searchResponse2 = _EsClientDAL.Current.Search<DTO.riSmall>(s => s .Size(50) .Query(q => q .Bool(b => b .Must(mu => mu .Match(m => m .Field(f => f.SceneText) .Query(queryString) ) , mu => !mu .Term(p => p.SceneText, "not") ) ) ) .Highlight(h => h .PreTags("|") .PostTags("|") .Fields( fs => fs .Field(p => p.SceneText) .Type("plain") .ForceSource() .FragmentSize(150) .NumberOfFragments(3) .NoMatchSize(150) ) ) );
you can try with following query using must_not Query(q => q .Bool(b => b .Must(mu => mu .Match(m => m .Field(f => f.SceneText) .Query(queryString) ) ) .MustNot(mn=> mn .Term(p => p.SceneText, "not") ) ) ) Hope this helps you
Parallel.Foreach - NULL Tasks
Force a Subclass to Define Extra Fields in C#
Await doesn't work with BeginInvoke?
.NET system-wide EventWaitHandle name allowed characters
c# sqlite command formatting
System.InvalidOperationException when getting a List with an ApiController
Calling a method from one class in another.
Black objects on screen in Unity3D
WP 8 - How to Open Menu with Application Bar Icon Button
Text box getting cleared beacause of update panel
Serialize a class that uses reflection to fill its properties
data type issue with dbnull c#
How to upload multiple files to server with form post MVC?
Retrieve and update record with Entity Framework in web app
Casting as a form from a window handle
C# DeflateStream Decompress with C++