Subject: | [Solr4] Suppor for atomic updates |
Hello,
I've made a patch to add support for atomic updating in Solr4 as
documented in
http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22
field.22
Hope this helps!
Subject: | field.patch |
--- Field.pm.old 2013-01-07 13:02:29.313145580 +0100
+++ Field.pm 2013-01-07 13:05:51.480151612 +0100
@@ -38,9 +38,18 @@
return $self->{ boost };
}
+sub update {
+ my $self = shift;
+ $self-> { update } = $_->[0] if @_;
+ return $self->{ update };
+}
+
sub to_element {
my $self = shift;
- my %attr = ( $self->boost ? ( boost => $self->boost ) : () );
+ my %attr = (
+ $self->boost ? ( boost => $self->boost ) : (),
+ $self->update ? ( update => $self->update ) : (),
+ );
return XML::Easy::Element->new(
'field',
@@ -80,6 +89,8 @@
=item * value - the field's value
+=item * update - for atomic updating (only for Solr4.0)
+
=item * boost - a floating-point boost value
=back
@@ -88,8 +99,8 @@
=head2 new( $name => $value, \%options )
-Creates a new field object. Currently, the only option available is a
-"boost" value.
+Creates a new field object. Currently, the available options available are
+"boost" and "update" values.
=head2 BUILDARGS( @args )
@@ -114,7 +125,7 @@
Copyright 2008-2012 National Adult Literacy Database
This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
+it under the same terms as Perl itself.
=cut