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
Call a web service from a desktop application in c#
Get members of custom class to read their values
Dynamically include/exclude fields in where clause LINQ
How do I send an Email using c#?
visual studio 2015 the following error occurred attempting to run the project model server process(1.0.3)
Stored procedure OUTPUT VARCHAR2 value truncated using 12c client
LINQ to Entities does not recognize the method 'System.String ToString(System.String)
How to get from a hashset all the elements that are of a particular subclass in c#?
enforce the DirectShow to select my video device via lan
Why are settings.settings variables not updating when I assign to them?
C# Chart crashes if there is a big Y-value
Backup localDB database in ClickOnce
how to populate text boxes based on dropdownlist selection mvc
Printing listview using loop prints all rows on the same line C#
Overcoming lack of app.config in SSIS Script Task to resolve memory exception issues
Popup still shows when not minimized