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

Change color line in listview
Simple database for Windows 8
Displaying Images with C#
Convert sequences to Generic Lists with svcutil
Prevent form from receiving mouse clicks
Save image in database visual studios
Print the content of tablelayoutpanel after clicking a button C#
Uploading file through an action of a controller - two forms in one view
Accessing WCF webservice using browser
Object reference not set to an instance of an object while the same method worked before
WinForm to WebForm?
How to tell if a textbox is focused in the OS or not?
Animating `visible` property in winforms
String.Remove giving error [closed]
databinding with isolated storage
When to use Visual Studio C# “Validated” / “Validating” Events

Categories

HOME
gulp
model-view-controller
google-cloud-pubsub
algolia
kendo-ui
pelican
phantomjs
nagios
nltk
okhttp3
arguments
squeak
perl6
jshell
richtextbox
atlassian-fisheye
kohana
symfony-3.2
zabbix
soap-client
jcodemodel
desktop-application
tag-cloud
smooth-scrolling
samba
powerpivot
md2
autologin
summernote
url-parameters
android-wifi
connectiq
jira-zephyr
tftp
proof-general
xlib
openoffice-impress
selenium3
opencsv
mplab
lighting
kepserverex
iterm2
fisheye
rbac
susy
head
piranha-cms
weld
activeandroid
g77
spring-cloud-bus
dna-sequence
jcifs
totalview
business-catalyst
was
esprima
turbolinks
mavlink
class-design
jira-agile
init
key-value-store
gdi
mrunit
pyshark
trendline
jsondoc
fadein
wonderware
persian
pushwoosh
hexagonal-tiles
tidesdk
minko
parseexception
asp.net-2.0
alpha-beta-pruning
random-access
unityvs
powerpoint-2010
xts
step
satisfiability
azure-caching
image-preloader
fastcgi-mono-server
cvi
logo-lang
myrrix
cocotron
coinbase-php
codeigniter-form-helper
architectural-patterns
boost.build
junit-rule
doxia
towerjs
joomla1.7
utm
pex-and-moles
object-tag
pixel-bender





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