Created
May 27, 2011 11:06
-
-
Save kimchy/995045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:9200/_search -d '{ | |
"query" : { | |
"filtered" : { | |
"query" : {"match_all" : {}}, | |
"filter" : { | |
"and" : [ | |
{ | |
"range" : { | |
"file_size" : {"from" : 10, "to" : 10000} | |
} | |
}, | |
{ | |
"range" : { | |
"file_size" : {"from" : 10001, "to" : 1000001} | |
} | |
} | |
] | |
} | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to do multiple filters against a NESTED object. The keyword in the nested object is setup not_analyzed. It works great with one filter but once I add the other I get nothing back. What might I be doing wrong?
Here is the REST JSON code I'm using:
{
"query": {
"nested": {
"_scope": "productscope",
"path": "productkeywords",
"score_mode": "avg",
"query" : {
"filtered" : {
"query": { "match_all" : {} },
"filter" : {
"and" : [
{
"term" : {"productkeywords.keyword": "Wi-Fi" }
},
{
"term" : {"productkeywords.keyword": "Other" }
}
]
}
}
}
}
}
}
Here is an example of the JSON result that works:
The iDigi Telehealth Application Kit enables the creation of secure, highly scalable cloud-connected healthcare gateway solutions right out of the box. Based on the Freescale® Semiconductor Home Health Hub reference design, this kit brings wireless and wired connectivity to a wide array of healthcare devices and sensors. The iDigi® Device Cloud™ provides remote management and secure data integration capabilities, allowing customers to build innovative and connected telehealth solutions for the medical and healthcare market.
",
"teasertext": "
",
"shortdescription": "Cloud-enabled Home Health Hub reference design",
"productkeywords":
[
{
"keywordcategoryid": 1,
"keywordcategory": "Frequency",
"keywordcategoryslug": "freq",
"keywordid": 6,
"keyword": "Other",
"keywordslug": "other"
},
{
"keywordcategoryid": 2,
"keywordcategory": "Wireless Products",
"keywordcategoryslug": "wireless",
"keywordid": 8,
"keyword": "Wi-Fi",
"keywordslug": "wifi"
},
{
"keywordcategoryid": 2,
"keywordcategory": "Wireless Products",
"keywordcategoryslug": "wireless",
"keywordid": 10,
"keyword": "ZigBee",
"keywordslug": "zigbee"
},
{
"keywordcategoryid": 3,
"keywordcategory": "Wired Connectivity",
"keywordcategoryslug": "wired",
"keywordid": 13,
"keyword": "Ethernet",
"keywordslug": "ethernet"
},
{
"keywordcategoryid": 3,
"keywordcategory": "Wired Connectivity",
"keywordcategoryslug": "wired",
"keywordid": 15,
"keyword": "Serial",
"keywordslug": "serial"
}
]
}
}