Elasticsearch - 查找存在的索引模式

时间:2017-03-19 12:43:01

标签: python-2.7 rally elasticsearch-5 pyral

我使用Python脚本从Rally API获取数据,操纵它并发送到Elasticsearch。 我试图找出如何在脚本代码中找到我现有的索引。我的ES实例非常简单:

System.Windows.Forms.Cursor.Position

我无法找到此实例中存在索引的位置

我的目的是说明更新我的索引数据的条件

有什么想法吗?

TNX

1 个答案:

答案 0 :(得分:1)

好的,我找到了解决方案,而且使用起来非常简单。只需输入:

<?php
if (isset($_POST['post'])){

// GET EMAIL
        $site_name = $_POST["site_name"];
        $URL = $_POST["URL"];
        $protocol = $_POST["protocol"];
        $author = $_POST["author"];
         $description = $_POST["description"];
        $currentdate = date('d F Y');
$filename = getcwd() . "/dummy.php"; 
$site_name_line = 1; 
$URL_line = 3; 
$protocol_line = 5; 
$author_line = 7; 
$description_line = 9; 
$currentdate_line = 11;
$lines = file( $filename , FILE_IGNORE_NEW_LINES ); 
$lines[$site_name_line] =   "$site_name";
$lines[$URL_line] = "$URL";
$lines[$protocol_line] =    "$protocol";
$lines[$author_line] =  "$author";$lines[$description_line] =   "$description";$lines[$currentdate_line] =  "$currentdate";
file_put_contents( $filename , implode( "\n", $lines ) );
}
?>