Postgresql stored procedure integrate with elastic search

179 Views Asked by At

I have to index PostgreSQL Stored Procedure which is having million of records. Can someone let me know the process how to do indexing the Stored Procedure into elastic search.

Without using parameter I want to download whole data in elastic search. Please help me:

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

There are 0 best solutions below