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

Invoking generic method from Main using reflection
OOP Method Usage [closed]
Calculate Age based on Visit Date
How to update a TextView text (decode text effect)?
C# faculty : weird results [duplicate]
Which MVC version to start with [closed]
What is “88-type” in C# and how can i use it?
C# Regex to convert yyyyMMddhhmm
EntityFramework package version=“6.1.3” and Web config version 6.0.0.0?
How to read a binary formatted string from a file?
Why My combobox binding not working
convert timespan to datetime
call to method inside code behind file(aspx.cs file) from controller method
Casting exposes private data via getter method
How to get a proper date from a text?
Problems converting an Oracle plsql stored procedure call to C# (invalid array bind size)

Categories

HOME
ssh
compression
phantomjs
glsl
assign
snmp
open-search-server
browserstack
clip-path
ng2-charts
hdf5
browsermob
popup
responsive
openscad
amazon-data-pipeline
windows-phone
udeploy
mex
typeorm
sqldependency
units-of-measurement
tikz
urhosharp
spring-oauth2
oracle-nosql
wunderground
pymunk
blueimp
usernotifications
file-conversion
ui-grid
azure-web-roles
aspnetboilerplate
definition
runner
rivets.js
remap
denodo
pyopenssl
nservicebus6
androiddesignsupport
trusted-computing
ios-keyboard-extension
qudpsocket
mavlink
scikit-image
dbi
joystick
konakart
git-cherry-pick
kik
sbt-proguard
treelist
alchemy
wordpress-plugin
instabug
taverna
syncano
properties-file
borland-c++
vensim
targetprocess
genero
skview
mathics
quickfixn
crystal-reports-7
unityvs
zoneminder
disparity-mapping
dotcmis
triplestore
atg-dynamo
farpoint-spread
class-library
internet-radio
carrier
lastinsertid
code-complete
grunt-contrib-imagemin
8-puzzle
wpd
asp.net-4.0
gmail-imap
vline
configurationsection
invalidoperationexception
mail-gem
scsf
noise-reduction
arraycollection
uccapi
mdd
datadude
high-load

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