Skip to content

Solr 4.0 Plugin which allows atomic update of lucene document more intuitively

Notifications You must be signed in to change notification settings

dikshantshahi/SolrAtomicUpdatePlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

SolrAtomicUpdatePlugin

Solr 4.0 Plugin which allows atomic update of lucene document more intuitively. The plugin supports update on the basis of Solr query. Update of multiValued field is also supported.

Internally Lucene doesn't allows you to update a document. The concept is simple delete and add.

This plugin allows you to update a document. It internally does a query, fetch, delete and add, thus releaving the client application from doing the same. Another important feature of the plugin is that it allows you to perform SQL like update. It you are DB user, you will find this plugin more intuitive. The user can specify solr query which uniquely identifies a document to be updated.

Installation Steps:

  1. Download the plugin file from dist/solr-atomic-update-plugin1.0.jar and place it in the SOLR_HOME/lib directory.
  2. Add the following handler in solrconfig.xml sql-like-processor
  3. Add the following processor chain in solrconfig.xml
  4. Ensure that both the tags are added inside config tag.

Usage:

Fields in document can be updated querying Solr just the way we query database. Here are different provisions to do that.

XML format to update a document: standard solr query value1 value2 ... ...

Also, you can update the document as follows: value1 value2 ... ...

If you know the uniqueId for the document, you can update document as follows: value value1 value2 ... ...

Example:

Update the employee skills as follows: $ curl http://localhost:8983/solr/sql-like-update -H 'Content-type:application/xml' -d ' empId:12345 SSE Solr Lucene ... '

Limitations:

  1. All the fields should be stored.
  2. Not tested for documents with index time boosts. Behavior unknown.
  3. Each query should return only one document.
  4. Has not been designed to support inc and adding values to a field, as Solr out of the box supports it. Please refer to Solr Wiki or by blog on out of the box feature http://dsahi.wordpress.com/2012/12/18/solr-atomic-update/.

About

Solr 4.0 Plugin which allows atomic update of lucene document more intuitively

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages