Coder Social home page Coder Social logo

freedev / kafka-solr-sink-connector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bkatwal/kafka-solr-sink-connector

1.0 2.0 0.0 143 KB

This is simple JSON based solr sink kafka connector, uses solr cloud

License: Apache License 2.0

Java 100.00%

kafka-solr-sink-connector's Introduction

kafka-solr-sink-connector

This is simple Java based solr sink kafka connector, that takes plain json data from kafka topic and push to solr, both solr cloud and standalone mode supported.

Note: Only JSON data is supported and keep schemas.enable=false for value converter.

Configs Description:

Config Name Description Config Value Is Mandatory?
topics topic to listen to topic name Yes
solr.collection Solr Collection name where topic data needs to be pushed Collection Name Yes
solr.mode Mode on which solr is running, pass solr node url CLOUD or STANDALONE Yes
solr.url If solr.mode is CLOUD, pass comma seperated zookeeper url else pass standalone solr server url url Yes
connector.class Connector class name com.bkatwal.kafkaproject.SolrSinkConnector Yes
commit.within.ms commit within ms value for solr update, if none passes defaults to 10 ms int value No
Refer/Use configuration: config files

Features Supported:

  1. Json Data
  2. One level of child document update supported. Just pass, additional field, _childDocuments_ with the parent doc.
  3. Deleting a document is supported: To delete pass additional field _delete_ with value true in your record(no need to maintain this field in solr/solr schema file), this field will be removed before indexing data to solr. Based on boolean values(true/false) in _delete_, delete/insert operation is triggered
  4. Dynamic fields update. Pass a Map field in json doc. The field name will be used as prefix, so set dynamic field in managed_schema accordingly. Example:
{
    "field1": "doc1",
    "id":"1",
    "field2":"dome val,
    "dynamicField":
    {
      "df1":"val1",
      "df2":"val2",
      "df3":"val3"
    }
  }
  
  This will be transformed in solr as:
  dynamicField_df1 : val1, dynamicField_df2 : val2, dynamicField_df3 : val3 

You can have any field name for dynamic field, just have this defined in managed_schema. So, for above to work, dynamic field meeds to be defined in managed_schema file as below: <dynamicField name="dynamicField_*" type="string" indexed="true" stored="true"/>

Deploy Steps:

  1. build with: mvn clean package
  2. In target look for directory bkatwal-kafka-connect-solr-sink-< version >. Copy this directory to plugins path.
or download deployable artifact from : https://www.confluent.io/connector/solr-sink-connector/

kafka-solr-sink-connector's People

Contributors

bkatwal avatar freedev avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

Kristian Rickert avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.