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

How to intercept packets sent by a application and check what they have? [closed]
A method to sort through html files [closed]
SmtpClient.SendAsync() not receiving all messages I sent
OpenFileDialog no show in different AppDomain
Storing Reference to Non-Static Method
What is the best practice for login attempts and locking account accounts in asp.net membership provider
What's the deal with the version number attached the name of the dll?
How would you invoke an event with reflection?
Conditional Compile of Generic Methods
VS WinForm designer always changes custom constructor?
Run C# application from cmd
Knowing the status of a very long function (execution time) in another class [closed]
Add a single row containing text taking up entire area of WPF Datagrid
CGBitmapContext in MonoTouch throws invalid handle exception
Create a list to display the contents of a dictionary?
Get file to FileStream from remote path with another user credentials

Categories

HOME
intellij-idea
typo3
network-programming
xamarin.forms
nagios
overrides
comments
sitemap
jcodemodel
urllib2
dynamics-crm-2011
decoding
osrm
virtualenv
bookmarklet
multibinding
simd
civicrm
turn.js
xna
typedef
scrapy-spider
android-xml
my.cnf
tftp
sphinx4
spring-data-gemfire
intermec
ilog
bootcamp
minitest
javafxports
mongoid5
ng-lightning
collation
autodesk-data-management
python-venv
grails-2.0
android-doze-and-standby
azure-data-catalog
reqif
mef
seyren
therubyracer
blackberry-webworks
universe
jigsaw
hoare-logic
git-cherry-pick
gdi
kik
avi
mrunit
pebble-js
sqlxml
salesforce-service-cloud
custom-build-step
abstract
opendolphin
controlpanel
bioconductor
recode
biginsights
stereotype
grails-3.0.9
gcc-warning
bungeecord
method-overloading
frisby.js
unityvs
qf-test
sync
api-eveonline
parsefloat
mdp
ekevent
nsnumber
objectdatasource
xrandr
qt5.1
quit
nsscrollview
pdf-reader
socketasynceventargs
stl-algorithm
copyfile
cgaffinetransform
session-hijacking
digg
symfony-1.2
zipstream
google-local-search
pixel-bender
expander
ironpython-studio

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