Code Monkey home page Code Monkey logo

storm-solr's Introduction

Storm Solr Integration

Integrates Storm and Apache Solr by providing a generic and configurable backtype.storm.Bolt implementation that create Solr indexes based on your Storm Tuple objects.

Using as a Maven dependency

Building from Source

	$ mvn install

Declare it in your pom.xml

<dependency>
	<groupId>storm</groupId>
	<artifactId>storm-solr</artifactId>
	<version>1.0-SNAPSHOT</version>
</dependency>		

Usage

Basic Usage

The SimpleSolrBolt class provides a convenience constructor that takes only the URL where Solr is running as argument:

	IRichBolt solrBolt = new SimpleSolrBolt("http://localhost:8983/solr");

The above constructor will create a SolrBolt that writes to the "http://localhost:8983/solr" Solr instance. The idea here is to convert a Tuple into a SolrInputDocument.

For each field in the backtype.storm.Tuple received, the SimpleSolrBolt will write a SolrInputField into a SolrInputDocument. So keep in mind that you must have your tuple fields defined in your solr schema.xml.

For example, given a tuple value of:

	{id: 12345, username: "joaopedro", full_name: "João Pedro"}

Your Solr schema.xml could be something like this :

 <fields>   
  <field name="id"      	type="long"   	indexed="true"  stored="true"  multiValued="false" required="true"/>
  <field name="full_name"   type="string"   indexed="true"  stored="true"  multiValued="false" /> 
  <field name="username"    type="string"   indexed="true"  stored="true"  multiValued="false" /> 
 </fields> 

Important note

For performance reasons SolrBolt is not responsible for committing. I highly recommend leaving this job for Apache Solr. Take a look at autoCommit feature.

storm-solr's People

Watchers

 avatar James Cloos 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.