0
我在elasticsearch文件是这样的:Elasticsearch常规令牌
{
"user_id": 295,
"pictures": [
{"type_id": 201201, "picture_id": 543},
{"type_id": 201202, "picture_id": 544}
]
}
有目的的寻找用户与特定的图像类型我运行此查询:
curl -XGET localhost:9201/z/u/_search -d '{
"post_filter": {
"bool": {
"must": [
{
"script": {
"script": "doc['"'"'pictures.type_id'"'"'].values.contains(201201L)"
}
}
]
}
}
}'
它完美的作品!但是,当我运行此查询:
curl -XGET localhost:9201/z/u/_search -d '{
"post_filter": {
"bool": {
"must": [
{
"script": {
"script": "doc['"'"'pictures.type_id'"'"'].values.contains(201201)"
}
}
]
}
}
}'
它不会工作,查询之间的区别是201201L and 201201
。
有人能解释吗?
非常感谢! –
很高兴帮助! – Val