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