c#


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

Related Links

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

Categories

HOME
asp.net
redux
leaflet
aix
conceptual
nltk
msbi
aggregate-functions
procmon
sequence
qt4
box-api
ejb-3.0
olap
digital
core-data
resharper
chef-recipe
saucelabs
jsfiddle
game-engine
css-float
beacon
wai-aria
bootstrap-accordion
gsuite
aspxgridview
android-xml
continuous-fourier
pydub
android-6.0-marshmallow
offset
gitosis
sampling
repeat
kdevelop
latency
glide-image-library
electron-packager
datagridviewcombobox
firefox-developer-edition
taleo
stream-socket-client
denodo
django-tables2
noise
cloudconvert
jscoverage
sharpssh
aot
programming-pearls
multi-select
suitesparse
group
papyrus
visual-web-developer
geokit
falcon
sprockets
hfp
mrunit
innertext
ideavim
web-performance
yfiles
controlpanel
gulp-cdnizer
log4cxx
roslyn-code-analysis
autoscaling
android-filterable
photogrammetry
genome
mergecursor
backtrace
teamstudio-unplugged
report-builder2.0
mind-manager
formbuilder
redmine-plugins
banana-pi
yandex-api
smartxls
mongoid4
zend-db-table
objectdatasource
http-compression
windows-scheduler
cloudmade
biztalk-deployment
rfc822
junit-rule
big-endian
eeprom
helicontech
commonsware
joomla1.7
visual-leak-detector
xpolog
file-processing
youtube.net-api
object-tag
meego-harmattan
excellibrary
mass-emails
arraycollection
dynamic-scope
datadude
httpbrowsercapabilities

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App