Created
January 3, 2020 09:40
-
-
Save vector4wang/0d5d5cbfa57dd7b428d97c6eb8c77b63 to your computer and use it in GitHub Desktop.
[es] 查询nested不为空情况
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
{ | |
"query": { | |
"nested": { | |
"path": "areaJSon", | |
"query": { | |
"bool": { | |
"must": { | |
"exists": { | |
"field": "areaJSon" | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
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
{ | |
"query": { | |
"bool": { | |
"must": [ | |
{ | |
"term": { | |
"carPlate": "皖A12345" | |
} | |
}, | |
{ | |
"nested": { | |
"query": { | |
"bool": { | |
"must": { | |
"exists": { | |
"field": "parkingOrderFeeRecords" | |
} | |
} | |
} | |
}, | |
"path": "parkingOrderFeeRecords" | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment