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

Assigning a value to a dynamic type using reflection and bypassing the object cast\box that GetValue returns
C# - How do I print a string in another listbox?
How to get image from assets folder in windows phone 8.1 and assign it to a model's property
DICOM unsupported attributes
Entry Point Not Found for a application: WebDev.WebServer40.EXE -
C# WPF making tabitem border slightly thicker
Trouble with binding to a data grid nested inside of a tab control that has its data context pragmatically set
managing code supporting multiple devices
Use Azure Application Insights with Azure WebJob
Read string from serial port and store into 2 different arrays
Can I hide a .NET in-memory variable from Administrative user with physical access?
Saving a new disconnected entity with an existing nested entity without duplicating the existing entity
Username authentication in WCF service not working
How to determine the points (pixels) that are within a given polygon inscribed in an image
execute lines of code Simultaneous in asp.net
ServiceStack original Request DTO after Filter manipulation

Categories

HOME
joomla
algolia
ssh
intellisense
jquery-plugins
django-middleware
xss
jshell
procmon
sequence
doctrine2
revit-api
annyang
subprocess
normals
facebook-sharer
tracking
opendaylight
internet-explorer-7
hapijs
views
keystone
coccinelle
multipart
ckeditor4.x
rollupjs
openoffice-impress
arp
wordpress-rest-api
wercker
ports
leaderboard
rtsp
var
nshttpurlresponse
ack
ocamlbuild
jenkins-2
django-tables2
android-vectordrawable
androiddesignsupport
zedgraph
rmq
lightspeed
qt3d
android-music-player
ldd
avi
pebble-js
web-optimization
hana-sql-script
datamodel
google-finance-api
libgcrypt
transbase
jain-sip
hexagonal-tiles
android-networking
data-representation
system.diagnostics
tidesdk
sicstus-prolog
connection-timeout
backtrace
nsq
crystal-reports-7
react-os
azure-worker-roles
drawable
reactjs-native
webshim
rssi
logo-lang
imaplib
misfire-instruction
mobile-robots
aspnet-compiler
extensibility
cloudmade
nx
biztalk-deployment
ntdll
blotter
motordriver
doxia
webpage-screenshot
custom-cursor
dancer
jmesa
jqueryi-ui-buttonset
motorola-droid
inserthtml
scriptmanager
discussion-board
hwnd
numerical-computing
projectgen
asp.net-1.1

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App