我想列出ElasticSearch服务器上的所有索引.我试过这个:
curl -XGET localhost:9200/
Run Code Online (Sandbox Code Playgroud)
但它只是给了我这个:
{
"ok" : true,
"status" : 200,
"name" : "El Aguila",
"version" : {
"number" : "0.19.3",
"snapshot_build" : false
},
"tagline" : "You Know, for Search"
}
Run Code Online (Sandbox Code Playgroud)
我想要一个所有索引的列表..
有人可以解释一下这里发生了什么吗?
echo (18.99 * 100); // output: 1899
echo (int)(18.99 * 100); // output: 1898
Run Code Online (Sandbox Code Playgroud)
我唯一可以想到的是,1899实际上是1898.999999999999或其他东西,PHP正在转换它作为echo某种程度的一部分?如果是这样的话,为什么呢?如果没有,这种奇怪行为的原因是什么?
我正在尝试在我的apache2配置文件中禁用函数,但由于某种原因它无法正常工作.我已经验证了其他php_admin_value设置正在运行,但它只是忽略了disable_functions
这就是我所拥有的:
<Directory "/var/www/testdir/*">
php_admin_value open_basedir "/var/www/testdir"
php_admin_value disable_functions "exec,shell_exec"
</Directory>
Run Code Online (Sandbox Code Playgroud)
open_basedir管理员值正在按预期工作(不能包含'../something'),但是,它仍然会执行ls -a ..或让我exec('ls -a ..', $output); echo $output;仿佛无法设置disable_functions标志.
有想法该怎么解决这个吗?
我需要能够根据一组对象获取一个集合.为此,我正在考虑几种方法,但我不确定哪种方法最有意义,所以我会发布它们.如果有更好的方式我可能没有考虑过,那么请随意发表你的建议:)
例如,我将使用产品和评论(产品评论)作为资源.
目标:我们希望得到所有产品的评论
方法A:
POST api/Products { json: filters, limits, etc } // returns api/Products/<id>
GET api/Products/<id>/Reviews { json: filters, limits, etc } // returns json array
// ... of reviews present in products
// id in this case would refer to the collection, which would be cached
Run Code Online (Sandbox Code Playgroud)
方法B:
GET api/Reviews { json: filters } // returns json array of reviews, but needs to
// ... have either all of the product ids passed as an array (not practical with …Run Code Online (Sandbox Code Playgroud)