Sign inSign up

ca0abinary/sql-solr

By ca0abinary

•Updated about 4 years ago

A tool to migrate Microsoft SQL Server data into a Solr server

Image
0

107

ca0abinary/sql-solr repository overview

⁠Microsoft SQL Server & Solr Hybrid Container

latest release

This is the unholy love child of microsoft sql server and solr docker images

At its core this is just the Dockerfile and scripts from github.com/docker-solr/docker-solr/tree/master/version/slim with the sql server as base image, usql⁠ added, and the minimal changes needed to make it all work on both intel and arm architectures.

The objective of this container is to support the following build process:

  1. Start SQL Server
  2. Start Solr
  3. Restore a SQL database backup
  4. DIH import that data into a Solr core
  5. Copy that data from this build-container to an empty solr⁠ container for deployment

⁠Example Usage

Setup an environment with the following folders

  • data/ Contains the sql backup file to restore (in the following example it's named solr_export.bak)
  • cores/ Contains the solr core definition folders (one folder for each core)
    • In the example below the cores MyCore1,MyCore2,MyCore3, and MyCore4 are loaded using the wait-for-solr-load.sh script included in this container

    • This process uses Solr's DataImportHandler⁠ so a DIH configuration must be a part of your solr core definition.

      • Example data-config.xml

        <?xml version="1.0" encoding="UTF-8" ?>
        <dataConfig>
            <dataSource driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost;databaseName=solr_export;user=sa;password=P@ssword123;" batchSize="10000" responseBuffering="adaptive" selectMethod="cursor"/>
            <document>
                <entity pk="Id" name="MyDataTable" query="SELECT * FROM MyDataTable;"/>
            </document>
        </dataConfig>
        
    • Create a Dockerfile similar to this one⁠.

The build process will result in a runnable solr instance containing the data from SQL.

An example⁠ is available.

Tag summary

Content type

Image

Digest

sha256:ebff4b851…

Size

1.1 GB

Last updated

about 4 years ago

docker pull ca0abinary/sql-solr:8.11.1