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

MonoGame porting to linux
Add to usings doesn't appear as resolve option in Visual Studio 2015
Outlined font effect for text in WPF
How to draw tensor visualization on a 2D grid
NullReferenceException C# [duplicate]
c# How do I detect if a line (painted/drawn on a form) has been clicked on when using winforms?
Parse the css content in C#
Stripe.net - Try to charge on behalf
Running oracle script in c#
How to calculate Sum of Peak and Offpeak hours in List<TimeSpan>
MySQL preprocessor optimization
Two methods with the same signature except for optional parameter
Set value of an object based on combobox selection (xaml / c#, uwp)
How to add space between two lines of a string in C#?
Entity Framework creating duplicate entities
Parameter '?user_email' not found in the collection

Categories

HOME
ckan
algolia
azure-documentdb
ldap
window.open
blob
nagios
skypedeveloper
magento-1.9.2.1
crash
swap
docker-compose
opacity
qt4
rmarkdown
genexus
token
core-data
aws-sdk-cpp
captcha
web-testing
datazen-server
concatenation
procedural-generation
ps
waterfall
ckeditor4.x
libxml2
angular2-changedetection
request-uri
ipython-parallel
jql
spring-oauth2
snapkit
restler
javax
certbot
word-wrap
aspnetboilerplate
irr
php-mongodb
encoder
azure-data-catalog
ocamlbuild
yank
boost-regex
senti-wordnet
printer-control-language
tsc
scrollmagic
msiexec
stripes
zsh-completion
toggleclass
key-value-store
gdi
jde
innertext
ooad
google-app-engine-php
ewam
angular-promise
php-gd
android-togglebutton
avrcp
firewire
stereotype
tidesdk
genome
teamstudio-unplugged
drools-guvnor
uiblureffect
information-hiding
report-builder2.0
qf-test
diffmerge
formbuilder
selenium-grid2
nest-initiative
mvcgrid
sendy
db2-connect
xtify
xml-validation
zend-db-table
playing-cards
typography
wpd
uikit-dynamics
blotter
setcookie
linqdatasource
qt5.1
freeimage
pinchzoom
nsundomanager
zend-validate
mcpd
gmagick
method-call
jqtransform
moss2007-security
viewdata
silverlight-2.0
focus-stealing
scala-designer

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