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

Adding IValueConverter breaks updates when changed occur from observable collection to UI
To Use or Not To Use the 'this' qualifier in C# [duplicate]
How to deserialize json into a c# class containing interface/abstract class properties
Javascript: decoding a string
Lock on Dictionary's TryGetValue() - Performance issues
Convert SQL to Linq - how to?
C#/Winforms, DataGridView/Combobox
Get rid of <ArrayOfClassname> root element when serializing array
How to install Microsoft Spec# 2010
How to print after join linq query
Changing the View for a ViewModel
how to attach a c# object to an excel worksheet and have it saved when the workbook is saved
Simplest way to filter generic list
Why does Response.Redirect() work in Chrome but not in IE?
C# storing data from input to arraylist inside Class
GeckoEngine and C# load dll drivers problem

Categories

HOME
oauth-2.0
algolia
azure-documentdb
ftp
netty
alasql
compression
jenkins-pipeline
openacc
wifi
hiveql
query-string
sdk
zabbix
pdf-generation
cracking
theory
core-data
decoding
fine-uploader
responsive
dompdf
turn.js
hololens
prepros
handle
mongoose-im
typeorm
pushpad
mobile-development
login-required
qt-designer
eclipse-jdt
rtos
android-scrollview
anypoint-studio
pygraphviz
mockserver
aspose.pdf
mtm
paperclip
grails-2.0
history
stringbuilder
scikit-image
dimensionality-reduction
x12
mate-desktop
syslog4j
change-password
laterjs
razorengine
archiva
paypal-subscriptions
android-progressbar
video-embedding
firefox-os
libgcrypt
jts
consul-template
dcg
polarion
xmla
sync
go-gin
famous-engine
agent-based-modeling
scjp
banana-pi
starling-framework
grunt-wiredep
ardor3d
grunt-contrib-imagemin
maven-webstart-plugin
magicsuggest
filedialog
winrt-async
pinchzoom
pex-and-moles
digg
s60
subdirectories
konsole
ihtmldocument2
authkit
jettison

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile