Postgresql存储过程与弹性搜索集成

时间:2016-07-28 06:51:38

标签: elasticsearch elasticsearch-plugin elasticsearch-jdbc-river

我必须索引拥有数百万条记录的PostgreSQL存储过程。有人可以告诉我如何将存储过程索引到弹性搜索中的过程。

不使用参数我想在弹性搜索中下载整个数据。请帮帮我:

bin=/home/elasticsearch-jdbc-2.3.1.0/bin
lib=/home/elasticsearch-jdbc-2.3.1.0/lib
echo '{
  "jdbc": {
    "driver": "org.postgresql.Driver",
    "url": "jdbc:postgresql://localhost:5432/testdb",
    "user": "b2g_mns",
    "password": "b2gmns",
    "sql": [
      {
        "callable": true,
        "statement": "{call  cloud10k.sp_fs_comp_search(?::varchar, ?::varchar, ?::varchar, ?::bigint)}",
        "parameter": [
          "CITI",
          "ALL",
          "ALL",
          0
        ]
      }
    ],
    "index": "my_jdbc_river03",
    "type": "my_jdbc_river03"
  }
}' | java \
      -cp "/home/elasticsearch-jdbc-2.3.1.0/lib/*" \
      -Dlog4j.configurationFile=/home/elasticsearch-jdbc-2.3.1.0
/bin/log4j2.xml \
       org.xbib.tools.Runner \
       org.xbib.tools.JDBCImporter

0 个答案:

没有答案