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
How to intercept packets sent by a application and check what they have? [closed]
A method to sort through html files [closed]
SmtpClient.SendAsync() not receiving all messages I sent
OpenFileDialog no show in different AppDomain
Storing Reference to Non-Static Method
What is the best practice for login attempts and locking account accounts in asp.net membership provider
What's the deal with the version number attached the name of the dll?
How would you invoke an event with reflection?
Conditional Compile of Generic Methods
VS WinForm designer always changes custom constructor?
Run C# application from cmd
Knowing the status of a very long function (execution time) in another class [closed]
Add a single row containing text taking up entire area of WPF Datagrid
CGBitmapContext in MonoTouch throws invalid handle exception
Create a list to display the contents of a dictionary?
Get file to FileStream from remote path with another user credentials