This is the mapping.
curl -XPUT 'localhost:9200/products/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 6,
"number_of_replicas" : 1
}
},
"mappings" : {
"product" : {
"_all":{ "enabled": true },
"properties":{
"id" : { "type" : "string", "index" : "not_analyzed", "include_in_all": true },
"description" : { "type" : "string" },
"title" : { "type" : "string", "boost" : 2 },
}
}
}
}'
I don't want to get the ads which have no description. but as you can see in mapping "description" have an index. So how do I use not query in description? please help me out.
I seen the doc of elasticsearch and I use this query.
**query => {
filtered => {
filter => {
not => {
filter => {
term => {description => ''}
}
}
},
query => {
match => { _all => $q }
}
}
}**
But it's not working, I think because description have index right?