How to use Elastic Search on top of a pre-existing SQL Database?

前端 未结 2 1784
-上瘾入骨i
-上瘾入骨i 2020-12-22 18:33

I\'ve been reading through a lot of good documentation about how to implement Elastic Search on a website with javascript or PHP.

Very good introduction to ES.

相关标签:
2条回答
  • 2020-12-22 18:42

    I am using jdbc-river w/ mysql. It is very fast. You can configure them to continually poll data, or use one-time (one-shot strategy) imports.

    e.g.

    curl -xPUT http://es-server:9200/_river/my_river/_meta -d '
    {
        "type" : "jdbc",
        "jdbc" : {
            "strategy" : "simple",
            "poll" : "5s",
            "scale" : 0,
            "autocommit" : false,
            "fetchsize" : 10,
            "max_rows" : 0,
            "max_retries" : 3,
            "max_retries_wait" : "10s",
            "driver" : "com.mysql.jdbc.Driver",
            "url" : "jdbc:mysql://mysql-server:3306/mydb",
            "user" : "root",
            "password" : "password*",
            "sql" : "select c.id, c.brandCode, c.companyCode from category c"
        },
        "index" : {
            "index" : "mainIndex",
            "type" : "category",
            "bulk_size" : 30,
            "max_bulk_requests" : 100,
            "index_settings" : null,
            "type_mapping" : null,
            "versioning" : false,
            "acknowledge" : false
        }
    }'
    
    0 讨论(0)
  • 2020-12-22 19:03

    If you need a more performant and scalable solution to the polling offered by jdbc-river, I recommend that you watch this presentation that explains how to perform incremental syncing from SQL Server into Elastic Search:

    The principles discussed in the video also apply for other RDBMS -> NoSQL replication applications.

    • Adding Elasticsearch To An Existing .NET / SQL Server Application (You Tube)
    0 讨论(0)
提交回复
热议问题