我正在使用Elastic 5.5轻松过滤文档
使用“无痛”,查找带有strings字段的文档。
仅strings返回带字段的文档
所有文件均已退回。
只要有带strings字段的文档,所有文档都会返回。这可能是某种缓存问题。
PUT /test_idx
POST /test_idx/t/1
{
"strings": ["hello", "world"]
}
POST /test_idx/t/2
{
"numbers": [1, 2, 3]
}
Run Code Online (Sandbox Code Playgroud)
GET /test_idx/_search
{
"query": {
"bool": {
"filter": [
{
"script": {
"script": {
"lang": "painless",
"inline": "return doc.containsKey(params.keypath)",
"params": {"keypath": "strings"}
}
}
}
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": …Run Code Online (Sandbox Code Playgroud) 结束使用
options:
env:
Run Code Online (Sandbox Code Playgroud)
不完美,因为在构建步骤中不允许变量,但至少涵盖了环境。
GCPCloud build不会在substitutions节中替换变量。
有没有办法应用这些替换?
substitutions:
_HUGO_VERSION: "0.55.6"
_HUGO_IMG: gcr.io/$PROJECT_ID/hugo:$_HUGO_VERSION
Run Code Online (Sandbox Code Playgroud)
拥有$_HUGO_VERSION并$PROJECT_ID替换为值,得到:
_HUGO_IMG=gcr.io/foo/hugo:0.55.6
Run Code Online (Sandbox Code Playgroud)
但是 for 的值_HUGO_IMG从字面上看:
_HUGO_IMG=gcr.io/$PROJECT_ID/hugo:$_HUGO_VERSION
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 Cloud Run 上使用 Nginx 提供简单的静态页面。但容器无法正常开始服务。
容器正在启动,如以下回显的调试行所示docker-entrypoint.sh:
2019-05-26T22:19:02.340289Z testing config
2019-05-26T22:19:02.433935Z nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2019-05-26T22:19:02.434903Z nginx: configuration file /etc/nginx/nginx.conf test is successful
2019-05-26T22:19:02.436605Z starting on 8080
2019-05-26T22:19:02.487188Z2019/05/26 22:19:02 [alert] 6#6: prctl(PR_SET_DUMPABLE) failed (22: Invalid argument)
Run Code Online (Sandbox Code Playgroud)
并最终终止
2019-05-26T22:20:00.153060259ZContainer terminated by the container manager on signal 9.
Run Code Online (Sandbox Code Playgroud)
为了符合Cloud Run 服务合同,专门$PORT侦听docker-entrypoint.sh在.conf.d/*.conf
FROM nginx:1.15-alpine
COPY nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
Run Code Online (Sandbox Code Playgroud)
我非常有信心问题出在其中docker-entrypoint.sh …