incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [8/20] First commit of api changes.
Date Sun, 28 Oct 2012 00:20:59 GMT
http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-perl/Blur/Types.pm
----------------------------------------------------------------------
diff --git a/interface/gen-perl/Blur/Types.pm b/interface/gen-perl/Blur/Types.pm
index 32bfd09..b64a1c1 100644
--- a/interface/gen-perl/Blur/Types.pm
+++ b/interface/gen-perl/Blur/Types.pm
@@ -26,6 +26,27 @@ use constant DELETE_ENTIRE_RECORD => 0;
 use constant REPLACE_ENTIRE_RECORD => 1;
 use constant REPLACE_COLUMNS => 2;
 use constant APPEND_COLUMN_VALUES => 3;
+package Blur::TYPE;
+use constant STRING => 0;
+use constant BOOL => 1;
+use constant SHORT => 2;
+use constant INT => 3;
+use constant LONG => 4;
+use constant FLOAT => 5;
+use constant DOUBLE => 6;
+use constant BINARY => 7;
+package Blur::SortType;
+use constant SCORE => 0;
+use constant DOC => 1;
+use constant STRING => 2;
+use constant INT => 3;
+use constant FLOAT => 4;
+use constant LONG => 5;
+use constant DOUBLE => 6;
+use constant SHORT => 7;
+use constant BYTE => 8;
+use constant STRING_VAL => 9;
+use constant BYTES => 10;
 package Blur::BlurException;
 use base qw(Thrift::TException);
 use base qw(Class::Accessor);
@@ -3313,4 +3334,1276 @@ sub write {
   return $xfer;
 }
 
+package Blur::Attribute;
+use base qw(Class::Accessor);
+Blur::Attribute->mk_accessors( qw( name value type ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{name} = undef;
+  $self->{value} = undef;
+  $self->{type} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{name}) {
+      $self->{name} = $vals->{name};
+    }
+    if (defined $vals->{value}) {
+      $self->{value} = $vals->{value};
+    }
+    if (defined $vals->{type}) {
+      $self->{type} = $vals->{type};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Attribute';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{name});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{value});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{type});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Attribute');
+  if (defined $self->{name}) {
+    $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
+    $xfer += $output->writeString($self->{name});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{value}) {
+    $xfer += $output->writeFieldBegin('value', TType::STRING, 2);
+    $xfer += $output->writeString($self->{value});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{type}) {
+    $xfer += $output->writeFieldBegin('type', TType::I32, 3);
+    $xfer += $output->writeI32($self->{type});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::Session;
+use base qw(Class::Accessor);
+Blur::Session->mk_accessors( qw( sessionId properties ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{sessionId} = undef;
+  $self->{properties} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{sessionId}) {
+      $self->{sessionId} = $vals->{sessionId};
+    }
+    if (defined $vals->{properties}) {
+      $self->{properties} = $vals->{properties};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Session';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{sessionId});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::MAP) {
+        {
+          my $_size147 = 0;
+          $self->{properties} = {};
+          my $_ktype148 = 0;
+          my $_vtype149 = 0;
+          $xfer += $input->readMapBegin(\$_ktype148, \$_vtype149, \$_size147);
+          for (my $_i151 = 0; $_i151 < $_size147; ++$_i151)
+          {
+            my $key152 = '';
+            my $val153 = '';
+            $xfer += $input->readString(\$key152);
+            $xfer += $input->readString(\$val153);
+            $self->{properties}->{$key152} = $val153;
+          }
+          $xfer += $input->readMapEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Session');
+  if (defined $self->{sessionId}) {
+    $xfer += $output->writeFieldBegin('sessionId', TType::STRING, 1);
+    $xfer += $output->writeString($self->{sessionId});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{properties}) {
+    $xfer += $output->writeFieldBegin('properties', TType::MAP, 2);
+    {
+      $xfer += $output->writeMapBegin(TType::STRING, TType::STRING, scalar(keys %{$self->{properties}}));
+      {
+        while( my ($kiter154,$viter155) = each %{$self->{properties}}) 
+        {
+          $xfer += $output->writeString($kiter154);
+          $xfer += $output->writeString($viter155);
+        }
+      }
+      $xfer += $output->writeMapEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::QuerySession;
+use base qw(Class::Accessor);
+Blur::QuerySession->mk_accessors( qw( session queryId ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{session} = undef;
+  $self->{queryId} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{session}) {
+      $self->{session} = $vals->{session};
+    }
+    if (defined $vals->{queryId}) {
+      $self->{queryId} = $vals->{queryId};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'QuerySession';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRUCT) {
+        $self->{session} = new Blur::Session();
+        $xfer += $self->{session}->read($input);
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{queryId});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('QuerySession');
+  if (defined $self->{session}) {
+    $xfer += $output->writeFieldBegin('session', TType::STRUCT, 1);
+    $xfer += $self->{session}->write($output);
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{queryId}) {
+    $xfer += $output->writeFieldBegin('queryId', TType::STRING, 2);
+    $xfer += $output->writeString($self->{queryId});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::SortField;
+use base qw(Class::Accessor);
+Blur::SortField->mk_accessors( qw( field type reverse ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{field} = undef;
+  $self->{type} = undef;
+  $self->{reverse} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{field}) {
+      $self->{field} = $vals->{field};
+    }
+    if (defined $vals->{type}) {
+      $self->{type} = $vals->{type};
+    }
+    if (defined $vals->{reverse}) {
+      $self->{reverse} = $vals->{reverse};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'SortField';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{field});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{type});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{reverse});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('SortField');
+  if (defined $self->{field}) {
+    $xfer += $output->writeFieldBegin('field', TType::STRING, 1);
+    $xfer += $output->writeString($self->{field});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{type}) {
+    $xfer += $output->writeFieldBegin('type', TType::I32, 2);
+    $xfer += $output->writeI32($self->{type});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{reverse}) {
+    $xfer += $output->writeFieldBegin('reverse', TType::BOOL, 3);
+    $xfer += $output->writeBool($self->{reverse});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::Sort;
+use base qw(Class::Accessor);
+Blur::Sort->mk_accessors( qw( fields ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{fields} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{fields}) {
+      $self->{fields} = $vals->{fields};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Sort';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size156 = 0;
+          $self->{fields} = [];
+          my $_etype159 = 0;
+          $xfer += $input->readListBegin(\$_etype159, \$_size156);
+          for (my $_i160 = 0; $_i160 < $_size156; ++$_i160)
+          {
+            my $elem161 = undef;
+            $elem161 = new Blur::SortField();
+            $xfer += $elem161->read($input);
+            push(@{$self->{fields}},$elem161);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Sort');
+  if (defined $self->{fields}) {
+    $xfer += $output->writeFieldBegin('fields', TType::LIST, 1);
+    {
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
+      {
+        foreach my $iter162 (@{$self->{fields}}) 
+        {
+          $xfer += ${iter162}->write($output);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::DocLocation;
+use base qw(Class::Accessor);
+Blur::DocLocation->mk_accessors( qw( doc shardIndex ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{doc} = undef;
+  $self->{shardIndex} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{doc}) {
+      $self->{doc} = $vals->{doc};
+    }
+    if (defined $vals->{shardIndex}) {
+      $self->{shardIndex} = $vals->{shardIndex};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'DocLocation';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{doc});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{shardIndex});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('DocLocation');
+  if (defined $self->{doc}) {
+    $xfer += $output->writeFieldBegin('doc', TType::I32, 1);
+    $xfer += $output->writeI32($self->{doc});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{shardIndex}) {
+    $xfer += $output->writeFieldBegin('shardIndex', TType::I32, 2);
+    $xfer += $output->writeI32($self->{shardIndex});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::ScoreDoc;
+use base qw(Class::Accessor);
+Blur::ScoreDoc->mk_accessors( qw( score docLocation fields ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{score} = undef;
+  $self->{docLocation} = undef;
+  $self->{fields} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{score}) {
+      $self->{score} = $vals->{score};
+    }
+    if (defined $vals->{docLocation}) {
+      $self->{docLocation} = $vals->{docLocation};
+    }
+    if (defined $vals->{fields}) {
+      $self->{fields} = $vals->{fields};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'ScoreDoc';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::DOUBLE) {
+        $xfer += $input->readDouble(\$self->{score});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRUCT) {
+        $self->{docLocation} = new Blur::DocLocation();
+        $xfer += $self->{docLocation}->read($input);
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size163 = 0;
+          $self->{fields} = [];
+          my $_etype166 = 0;
+          $xfer += $input->readListBegin(\$_etype166, \$_size163);
+          for (my $_i167 = 0; $_i167 < $_size163; ++$_i167)
+          {
+            my $elem168 = undef;
+            $xfer += $input->readString(\$elem168);
+            push(@{$self->{fields}},$elem168);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('ScoreDoc');
+  if (defined $self->{score}) {
+    $xfer += $output->writeFieldBegin('score', TType::DOUBLE, 1);
+    $xfer += $output->writeDouble($self->{score});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{docLocation}) {
+    $xfer += $output->writeFieldBegin('docLocation', TType::STRUCT, 2);
+    $xfer += $self->{docLocation}->write($output);
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{fields}) {
+    $xfer += $output->writeFieldBegin('fields', TType::LIST, 4);
+    {
+      $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{fields}}));
+      {
+        foreach my $iter169 (@{$self->{fields}}) 
+        {
+          $xfer += $output->writeString($iter169);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::QueryArgs;
+use base qw(Class::Accessor);
+Blur::QueryArgs->mk_accessors( qw( after query filter numberToFetch sort doDocScores doMaxScore shardIndexes ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{after} = undef;
+  $self->{query} = undef;
+  $self->{filter} = undef;
+  $self->{numberToFetch} = undef;
+  $self->{sort} = undef;
+  $self->{doDocScores} = undef;
+  $self->{doMaxScore} = undef;
+  $self->{shardIndexes} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{after}) {
+      $self->{after} = $vals->{after};
+    }
+    if (defined $vals->{query}) {
+      $self->{query} = $vals->{query};
+    }
+    if (defined $vals->{filter}) {
+      $self->{filter} = $vals->{filter};
+    }
+    if (defined $vals->{numberToFetch}) {
+      $self->{numberToFetch} = $vals->{numberToFetch};
+    }
+    if (defined $vals->{sort}) {
+      $self->{sort} = $vals->{sort};
+    }
+    if (defined $vals->{doDocScores}) {
+      $self->{doDocScores} = $vals->{doDocScores};
+    }
+    if (defined $vals->{doMaxScore}) {
+      $self->{doMaxScore} = $vals->{doMaxScore};
+    }
+    if (defined $vals->{shardIndexes}) {
+      $self->{shardIndexes} = $vals->{shardIndexes};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'QueryArgs';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRUCT) {
+        $self->{after} = new Blur::ScoreDoc();
+        $xfer += $self->{after}->read($input);
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{query});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{filter});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{numberToFetch});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^5$/ && do{      if ($ftype == TType::STRUCT) {
+        $self->{sort} = new Blur::Sort();
+        $xfer += $self->{sort}->read($input);
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^6$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{doDocScores});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^7$/ && do{      if ($ftype == TType::BOOL) {
+        $xfer += $input->readBool(\$self->{doMaxScore});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^8$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size170 = 0;
+          $self->{shardIndexes} = [];
+          my $_etype173 = 0;
+          $xfer += $input->readListBegin(\$_etype173, \$_size170);
+          for (my $_i174 = 0; $_i174 < $_size170; ++$_i174)
+          {
+            my $elem175 = undef;
+            $xfer += $input->readI32(\$elem175);
+            push(@{$self->{shardIndexes}},$elem175);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('QueryArgs');
+  if (defined $self->{after}) {
+    $xfer += $output->writeFieldBegin('after', TType::STRUCT, 1);
+    $xfer += $self->{after}->write($output);
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{query}) {
+    $xfer += $output->writeFieldBegin('query', TType::STRING, 2);
+    $xfer += $output->writeString($self->{query});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{filter}) {
+    $xfer += $output->writeFieldBegin('filter', TType::STRING, 3);
+    $xfer += $output->writeString($self->{filter});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{numberToFetch}) {
+    $xfer += $output->writeFieldBegin('numberToFetch', TType::I32, 4);
+    $xfer += $output->writeI32($self->{numberToFetch});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{sort}) {
+    $xfer += $output->writeFieldBegin('sort', TType::STRUCT, 5);
+    $xfer += $self->{sort}->write($output);
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{doDocScores}) {
+    $xfer += $output->writeFieldBegin('doDocScores', TType::BOOL, 6);
+    $xfer += $output->writeBool($self->{doDocScores});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{doMaxScore}) {
+    $xfer += $output->writeFieldBegin('doMaxScore', TType::BOOL, 7);
+    $xfer += $output->writeBool($self->{doMaxScore});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{shardIndexes}) {
+    $xfer += $output->writeFieldBegin('shardIndexes', TType::LIST, 8);
+    {
+      $xfer += $output->writeListBegin(TType::I32, scalar(@{$self->{shardIndexes}}));
+      {
+        foreach my $iter176 (@{$self->{shardIndexes}}) 
+        {
+          $xfer += $output->writeI32($iter176);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::TopFieldDocs;
+use base qw(Class::Accessor);
+Blur::TopFieldDocs->mk_accessors( qw( totalHits scoreDocs maxScore fields ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{totalHits} = undef;
+  $self->{scoreDocs} = undef;
+  $self->{maxScore} = undef;
+  $self->{fields} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{totalHits}) {
+      $self->{totalHits} = $vals->{totalHits};
+    }
+    if (defined $vals->{scoreDocs}) {
+      $self->{scoreDocs} = $vals->{scoreDocs};
+    }
+    if (defined $vals->{maxScore}) {
+      $self->{maxScore} = $vals->{maxScore};
+    }
+    if (defined $vals->{fields}) {
+      $self->{fields} = $vals->{fields};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'TopFieldDocs';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::I64) {
+        $xfer += $input->readI64(\$self->{totalHits});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size177 = 0;
+          $self->{scoreDocs} = [];
+          my $_etype180 = 0;
+          $xfer += $input->readListBegin(\$_etype180, \$_size177);
+          for (my $_i181 = 0; $_i181 < $_size177; ++$_i181)
+          {
+            my $elem182 = undef;
+            $elem182 = new Blur::ScoreDoc();
+            $xfer += $elem182->read($input);
+            push(@{$self->{scoreDocs}},$elem182);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::DOUBLE) {
+        $xfer += $input->readDouble(\$self->{maxScore});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size183 = 0;
+          $self->{fields} = [];
+          my $_etype186 = 0;
+          $xfer += $input->readListBegin(\$_etype186, \$_size183);
+          for (my $_i187 = 0; $_i187 < $_size183; ++$_i187)
+          {
+            my $elem188 = undef;
+            $elem188 = new Blur::SortField();
+            $xfer += $elem188->read($input);
+            push(@{$self->{fields}},$elem188);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('TopFieldDocs');
+  if (defined $self->{totalHits}) {
+    $xfer += $output->writeFieldBegin('totalHits', TType::I64, 1);
+    $xfer += $output->writeI64($self->{totalHits});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{scoreDocs}) {
+    $xfer += $output->writeFieldBegin('scoreDocs', TType::LIST, 2);
+    {
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{scoreDocs}}));
+      {
+        foreach my $iter189 (@{$self->{scoreDocs}}) 
+        {
+          $xfer += ${iter189}->write($output);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{maxScore}) {
+    $xfer += $output->writeFieldBegin('maxScore', TType::DOUBLE, 3);
+    $xfer += $output->writeDouble($self->{maxScore});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{fields}) {
+    $xfer += $output->writeFieldBegin('fields', TType::LIST, 4);
+    {
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
+      {
+        foreach my $iter190 (@{$self->{fields}}) 
+        {
+          $xfer += ${iter190}->write($output);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::Field;
+use base qw(Class::Accessor);
+Blur::Field->mk_accessors( qw( name value type boost ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{name} = undef;
+  $self->{value} = undef;
+  $self->{type} = undef;
+  $self->{boost} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{name}) {
+      $self->{name} = $vals->{name};
+    }
+    if (defined $vals->{value}) {
+      $self->{value} = $vals->{value};
+    }
+    if (defined $vals->{type}) {
+      $self->{type} = $vals->{type};
+    }
+    if (defined $vals->{boost}) {
+      $self->{boost} = $vals->{boost};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Field';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{name});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{value});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::I32) {
+        $xfer += $input->readI32(\$self->{type});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^4$/ && do{      if ($ftype == TType::DOUBLE) {
+        $xfer += $input->readDouble(\$self->{boost});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Field');
+  if (defined $self->{name}) {
+    $xfer += $output->writeFieldBegin('name', TType::STRING, 1);
+    $xfer += $output->writeString($self->{name});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{value}) {
+    $xfer += $output->writeFieldBegin('value', TType::STRING, 2);
+    $xfer += $output->writeString($self->{value});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{type}) {
+    $xfer += $output->writeFieldBegin('type', TType::I32, 3);
+    $xfer += $output->writeI32($self->{type});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{boost}) {
+    $xfer += $output->writeFieldBegin('boost', TType::DOUBLE, 4);
+    $xfer += $output->writeDouble($self->{boost});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::Document;
+use base qw(Class::Accessor);
+Blur::Document->mk_accessors( qw( fields ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{fields} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{fields}) {
+      $self->{fields} = $vals->{fields};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Document';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::LIST) {
+        {
+          my $_size191 = 0;
+          $self->{fields} = [];
+          my $_etype194 = 0;
+          $xfer += $input->readListBegin(\$_etype194, \$_size191);
+          for (my $_i195 = 0; $_i195 < $_size191; ++$_i195)
+          {
+            my $elem196 = undef;
+            $elem196 = new Blur::Field();
+            $xfer += $elem196->read($input);
+            push(@{$self->{fields}},$elem196);
+          }
+          $xfer += $input->readListEnd();
+        }
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Document');
+  if (defined $self->{fields}) {
+    $xfer += $output->writeFieldBegin('fields', TType::LIST, 1);
+    {
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{fields}}));
+      {
+        foreach my $iter197 (@{$self->{fields}}) 
+        {
+          $xfer += ${iter197}->write($output);
+        }
+      }
+      $xfer += $output->writeListEnd();
+    }
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
+package Blur::Term;
+use base qw(Class::Accessor);
+Blur::Term->mk_accessors( qw( field bytes ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{field} = undef;
+  $self->{bytes} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{field}) {
+      $self->{field} = $vals->{field};
+    }
+    if (defined $vals->{bytes}) {
+      $self->{bytes} = $vals->{bytes};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Term';
+}
+
+sub read {
+  my ($self, $input) = @_;
+  my $xfer  = 0;
+  my $fname;
+  my $ftype = 0;
+  my $fid   = 0;
+  $xfer += $input->readStructBegin(\$fname);
+  while (1) 
+  {
+    $xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
+    if ($ftype == TType::STOP) {
+      last;
+    }
+    SWITCH: for($fid)
+    {
+      /^1$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{field});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{bytes});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+        $xfer += $input->skip($ftype);
+    }
+    $xfer += $input->readFieldEnd();
+  }
+  $xfer += $input->readStructEnd();
+  return $xfer;
+}
+
+sub write {
+  my ($self, $output) = @_;
+  my $xfer   = 0;
+  $xfer += $output->writeStructBegin('Term');
+  if (defined $self->{field}) {
+    $xfer += $output->writeFieldBegin('field', TType::STRING, 1);
+    $xfer += $output->writeString($self->{field});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{bytes}) {
+    $xfer += $output->writeFieldBegin('bytes', TType::STRING, 2);
+    $xfer += $output->writeString($self->{bytes});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
 1;

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-rb/blur_types.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur_types.rb b/interface/gen-rb/blur_types.rb
index d79536a..3ca158d 100644
--- a/interface/gen-rb/blur_types.rb
+++ b/interface/gen-rb/blur_types.rb
@@ -40,6 +40,58 @@ module Blur
       VALID_VALUES = Set.new([DELETE_ENTIRE_RECORD, REPLACE_ENTIRE_RECORD, REPLACE_COLUMNS, APPEND_COLUMN_VALUES]).freeze
     end
 
+    module TYPE
+      STRING = 0
+      BOOL = 1
+      SHORT = 2
+      INT = 3
+      LONG = 4
+      FLOAT = 5
+      DOUBLE = 6
+      BINARY = 7
+      VALUE_MAP = {0 => "STRING", 1 => "BOOL", 2 => "SHORT", 3 => "INT", 4 => "LONG", 5 => "FLOAT", 6 => "DOUBLE", 7 => "BINARY"}
+      VALID_VALUES = Set.new([STRING, BOOL, SHORT, INT, LONG, FLOAT, DOUBLE, BINARY]).freeze
+    end
+
+    module SortType
+      # Sort by document score (relevance).  Sort values are Float and higher
+      # values are at the front.
+      SCORE = 0
+      # Sort by document number (index order).  Sort values are Integer and lower
+      # values are at the front.
+      DOC = 1
+      # Sort using term values as Strings.  Sort values are String and lower
+      # values are at the front.
+      STRING = 2
+      # Sort using term values as encoded Integers.  Sort values are Integer and
+      # lower values are at the front.
+      INT = 3
+      # Sort using term values as encoded Floats.  Sort values are Float and
+      # lower values are at the front.
+      FLOAT = 4
+      # Sort using term values as encoded Longs.  Sort values are Long and
+      # lower values are at the front.
+      LONG = 5
+      # Sort using term values as encoded Doubles.  Sort values are Double and
+      # lower values are at the front.
+      DOUBLE = 6
+      # Sort using term values as encoded Shorts.  Sort values are Short and
+      # lower values are at the front.
+      SHORT = 7
+      # Sort using term values as encoded Bytes.  Sort values are Byte and
+      # lower values are at the front.
+      BYTE = 8
+      # Sort using term values as Strings, but comparing by
+      # value (using String.compareTo) for all comparisons.
+      # This is typically slower than {@link #STRING}, which
+      # uses ordinals to do the sorting.
+      STRING_VAL = 9
+      # Sort use byte[] index values.
+      BYTES = 10
+      VALUE_MAP = {0 => "SCORE", 1 => "DOC", 2 => "STRING", 3 => "INT", 4 => "FLOAT", 5 => "LONG", 6 => "DOUBLE", 7 => "SHORT", 8 => "BYTE", 9 => "STRING_VAL", 10 => "BYTES"}
+      VALID_VALUES = Set.new([SCORE, DOC, STRING, INT, FLOAT, LONG, DOUBLE, SHORT, BYTE, STRING_VAL, BYTES]).freeze
+    end
+
     # BlurException that carries a message plus the original stack
     # trace (if any).
     class BlurException < ::Thrift::Exception
@@ -751,4 +803,251 @@ module Blur
       ::Thrift::Struct.generate_accessors self
     end
 
+    class Attribute
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      NAME = 1
+      VALUE = 2
+      TYPE = 3
+
+      FIELDS = {
+        NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
+        VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true},
+        TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => Blur::TYPE}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+        unless @type.nil? || Blur::TYPE::VALID_VALUES.include?(@type)
+          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
+        end
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class Session
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      SESSIONID = 1
+      PROPERTIES = 2
+
+      FIELDS = {
+        SESSIONID => {:type => ::Thrift::Types::STRING, :name => 'sessionId'},
+        PROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'properties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class QuerySession
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      SESSION = 1
+      QUERYID = 2
+
+      FIELDS = {
+        SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+        QUERYID => {:type => ::Thrift::Types::STRING, :name => 'queryId'}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class SortField
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      FIELD = 1
+      TYPE = 2
+      REVERSE = 3
+
+      FIELDS = {
+        FIELD => {:type => ::Thrift::Types::STRING, :name => 'field'},
+        TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => Blur::SortType},
+        REVERSE => {:type => ::Thrift::Types::BOOL, :name => 'reverse'}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+        unless @type.nil? || Blur::SortType::VALID_VALUES.include?(@type)
+          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
+        end
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class Sort
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      FIELDS = 1
+
+      FIELDS = {
+        FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::SortField}}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class DocLocation
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      DOC = 1
+      SHARDINDEX = 2
+
+      FIELDS = {
+        DOC => {:type => ::Thrift::Types::I32, :name => 'doc'},
+        SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class ScoreDoc
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      SCORE = 1
+      DOCLOCATION = 2
+      FIELDS = 4
+
+      FIELDS = {
+        SCORE => {:type => ::Thrift::Types::DOUBLE, :name => 'score'},
+        DOCLOCATION => {:type => ::Thrift::Types::STRUCT, :name => 'docLocation', :class => Blur::DocLocation},
+        FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRING, :binary => true}}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class QueryArgs
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      AFTER = 1
+      QUERY = 2
+      FILTER = 3
+      NUMBERTOFETCH = 4
+      SORT = 5
+      DODOCSCORES = 6
+      DOMAXSCORE = 7
+      SHARDINDEXES = 8
+
+      FIELDS = {
+        AFTER => {:type => ::Thrift::Types::STRUCT, :name => 'after', :class => Blur::ScoreDoc},
+        QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :binary => true},
+        FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter', :binary => true},
+        NUMBERTOFETCH => {:type => ::Thrift::Types::I32, :name => 'numberToFetch'},
+        SORT => {:type => ::Thrift::Types::STRUCT, :name => 'sort', :class => Blur::Sort},
+        DODOCSCORES => {:type => ::Thrift::Types::BOOL, :name => 'doDocScores'},
+        DOMAXSCORE => {:type => ::Thrift::Types::BOOL, :name => 'doMaxScore'},
+        SHARDINDEXES => {:type => ::Thrift::Types::LIST, :name => 'shardIndexes', :element => {:type => ::Thrift::Types::I32}}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class TopFieldDocs
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      TOTALHITS = 1
+      SCOREDOCS = 2
+      MAXSCORE = 3
+      FIELDS = 4
+
+      FIELDS = {
+        TOTALHITS => {:type => ::Thrift::Types::I64, :name => 'totalHits'},
+        SCOREDOCS => {:type => ::Thrift::Types::LIST, :name => 'scoreDocs', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::ScoreDoc}},
+        MAXSCORE => {:type => ::Thrift::Types::DOUBLE, :name => 'maxScore'},
+        FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::SortField}}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class Field
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      NAME = 1
+      VALUE = 2
+      TYPE = 3
+      BOOST = 4
+
+      FIELDS = {
+        NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
+        VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :binary => true},
+        TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => Blur::TYPE},
+        BOOST => {:type => ::Thrift::Types::DOUBLE, :name => 'boost'}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+        unless @type.nil? || Blur::TYPE::VALID_VALUES.include?(@type)
+          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
+        end
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class Document
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      FIELDS = 1
+
+      FIELDS = {
+        FIELDS => {:type => ::Thrift::Types::LIST, :name => 'fields', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Field}}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
+    class Term
+      include ::Thrift::Struct, ::Thrift::Struct_Union
+      FIELD = 1
+      BYTES = 2
+
+      FIELDS = {
+        FIELD => {:type => ::Thrift::Types::STRING, :name => 'field'},
+        BYTES => {:type => ::Thrift::Types::STRING, :name => 'bytes', :binary => true}
+      }
+
+      def struct_fields; FIELDS; end
+
+      def validate
+      end
+
+      ::Thrift::Struct.generate_accessors self
+    end
+
   end

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/interface/gen-rb/lucene.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/lucene.rb b/interface/gen-rb/lucene.rb
new file mode 100644
index 0000000..1825314
--- /dev/null
+++ b/interface/gen-rb/lucene.rb
@@ -0,0 +1,701 @@
+#
+# Autogenerated by Thrift Compiler (0.7.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+require 'thrift'
+require 'blur'
+require 'blur_types'
+
+    module Blur
+      module Lucene
+        class Client < Blur::Blur::Client 
+          include ::Thrift::Client
+
+          def openReadSession(table)
+            send_openReadSession(table)
+            return recv_openReadSession()
+          end
+
+          def send_openReadSession(table)
+            send_message('openReadSession', OpenReadSession_args, :table => table)
+          end
+
+          def recv_openReadSession()
+            result = receive_message(OpenReadSession_result)
+            return result.success unless result.success.nil?
+            raise result.e unless result.e.nil?
+            raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'openReadSession failed: unknown result')
+          end
+
+          def search(session, queryArgs)
+            send_search(session, queryArgs)
+            return recv_search()
+          end
+
+          def send_search(session, queryArgs)
+            send_message('search', Search_args, :session => session, :queryArgs => queryArgs)
+          end
+
+          def recv_search()
+            result = receive_message(Search_result)
+            return result.success unless result.success.nil?
+            raise result.e unless result.e.nil?
+            raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'search failed: unknown result')
+          end
+
+          def doc(session, docLocations, fields)
+            send_doc(session, docLocations, fields)
+            return recv_doc()
+          end
+
+          def send_doc(session, docLocations, fields)
+            send_message('doc', Doc_args, :session => session, :docLocations => docLocations, :fields => fields)
+          end
+
+          def recv_doc()
+            result = receive_message(Doc_result)
+            return result.success unless result.success.nil?
+            raise result.e unless result.e.nil?
+            raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'doc failed: unknown result')
+          end
+
+          def closeReadSession(session)
+            send_closeReadSession(session)
+            recv_closeReadSession()
+          end
+
+          def send_closeReadSession(session)
+            send_message('closeReadSession', CloseReadSession_args, :session => session)
+          end
+
+          def recv_closeReadSession()
+            result = receive_message(CloseReadSession_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+          def openWriteSession(table)
+            send_openWriteSession(table)
+            return recv_openWriteSession()
+          end
+
+          def send_openWriteSession(table)
+            send_message('openWriteSession', OpenWriteSession_args, :table => table)
+          end
+
+          def recv_openWriteSession()
+            result = receive_message(OpenWriteSession_result)
+            return result.success unless result.success.nil?
+            raise result.e unless result.e.nil?
+            raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'openWriteSession failed: unknown result')
+          end
+
+          def addDocuments(session, shardIndex, document)
+            send_addDocuments(session, shardIndex, document)
+            recv_addDocuments()
+          end
+
+          def send_addDocuments(session, shardIndex, document)
+            send_message('addDocuments', AddDocuments_args, :session => session, :shardIndex => shardIndex, :document => document)
+          end
+
+          def recv_addDocuments()
+            result = receive_message(AddDocuments_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+          def deleteDocumentsByQueries(session, shardIndex, queries)
+            send_deleteDocumentsByQueries(session, shardIndex, queries)
+            recv_deleteDocumentsByQueries()
+          end
+
+          def send_deleteDocumentsByQueries(session, shardIndex, queries)
+            send_message('deleteDocumentsByQueries', DeleteDocumentsByQueries_args, :session => session, :shardIndex => shardIndex, :queries => queries)
+          end
+
+          def recv_deleteDocumentsByQueries()
+            result = receive_message(DeleteDocumentsByQueries_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+          def deleteDocuments(session, shardIndex, terms)
+            send_deleteDocuments(session, shardIndex, terms)
+            recv_deleteDocuments()
+          end
+
+          def send_deleteDocuments(session, shardIndex, terms)
+            send_message('deleteDocuments', DeleteDocuments_args, :session => session, :shardIndex => shardIndex, :terms => terms)
+          end
+
+          def recv_deleteDocuments()
+            result = receive_message(DeleteDocuments_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+          def updateDocuments(session, shardIndex, terms, document)
+            send_updateDocuments(session, shardIndex, terms, document)
+            recv_updateDocuments()
+          end
+
+          def send_updateDocuments(session, shardIndex, terms, document)
+            send_message('updateDocuments', UpdateDocuments_args, :session => session, :shardIndex => shardIndex, :terms => terms, :document => document)
+          end
+
+          def recv_updateDocuments()
+            result = receive_message(UpdateDocuments_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+          def commit(session)
+            send_commit(session)
+            recv_commit()
+          end
+
+          def send_commit(session)
+            send_message('commit', Commit_args, :session => session)
+          end
+
+          def recv_commit()
+            result = receive_message(Commit_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+          def rollback(session)
+            send_rollback(session)
+            recv_rollback()
+          end
+
+          def send_rollback(session)
+            send_message('rollback', Rollback_args, :session => session)
+          end
+
+          def recv_rollback()
+            result = receive_message(Rollback_result)
+            raise result.e unless result.e.nil?
+            return
+          end
+
+        end
+
+        class Processor < Blur::Blur::Processor 
+          include ::Thrift::Processor
+
+          def process_openReadSession(seqid, iprot, oprot)
+            args = read_args(iprot, OpenReadSession_args)
+            result = OpenReadSession_result.new()
+            begin
+              result.success = @handler.openReadSession(args.table)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'openReadSession', seqid)
+          end
+
+          def process_search(seqid, iprot, oprot)
+            args = read_args(iprot, Search_args)
+            result = Search_result.new()
+            begin
+              result.success = @handler.search(args.session, args.queryArgs)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'search', seqid)
+          end
+
+          def process_doc(seqid, iprot, oprot)
+            args = read_args(iprot, Doc_args)
+            result = Doc_result.new()
+            begin
+              result.success = @handler.doc(args.session, args.docLocations, args.fields)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'doc', seqid)
+          end
+
+          def process_closeReadSession(seqid, iprot, oprot)
+            args = read_args(iprot, CloseReadSession_args)
+            result = CloseReadSession_result.new()
+            begin
+              @handler.closeReadSession(args.session)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'closeReadSession', seqid)
+          end
+
+          def process_openWriteSession(seqid, iprot, oprot)
+            args = read_args(iprot, OpenWriteSession_args)
+            result = OpenWriteSession_result.new()
+            begin
+              result.success = @handler.openWriteSession(args.table)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'openWriteSession', seqid)
+          end
+
+          def process_addDocuments(seqid, iprot, oprot)
+            args = read_args(iprot, AddDocuments_args)
+            result = AddDocuments_result.new()
+            begin
+              @handler.addDocuments(args.session, args.shardIndex, args.document)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'addDocuments', seqid)
+          end
+
+          def process_deleteDocumentsByQueries(seqid, iprot, oprot)
+            args = read_args(iprot, DeleteDocumentsByQueries_args)
+            result = DeleteDocumentsByQueries_result.new()
+            begin
+              @handler.deleteDocumentsByQueries(args.session, args.shardIndex, args.queries)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'deleteDocumentsByQueries', seqid)
+          end
+
+          def process_deleteDocuments(seqid, iprot, oprot)
+            args = read_args(iprot, DeleteDocuments_args)
+            result = DeleteDocuments_result.new()
+            begin
+              @handler.deleteDocuments(args.session, args.shardIndex, args.terms)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'deleteDocuments', seqid)
+          end
+
+          def process_updateDocuments(seqid, iprot, oprot)
+            args = read_args(iprot, UpdateDocuments_args)
+            result = UpdateDocuments_result.new()
+            begin
+              @handler.updateDocuments(args.session, args.shardIndex, args.terms, args.document)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'updateDocuments', seqid)
+          end
+
+          def process_commit(seqid, iprot, oprot)
+            args = read_args(iprot, Commit_args)
+            result = Commit_result.new()
+            begin
+              @handler.commit(args.session)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'commit', seqid)
+          end
+
+          def process_rollback(seqid, iprot, oprot)
+            args = read_args(iprot, Rollback_args)
+            result = Rollback_result.new()
+            begin
+              @handler.rollback(args.session)
+            rescue Blur::BlurException => e
+              result.e = e
+            end
+            write_result(result, oprot, 'rollback', seqid)
+          end
+
+        end
+
+        # HELPER FUNCTIONS AND STRUCTURES
+
+        class OpenReadSession_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          TABLE = 1
+
+          FIELDS = {
+            TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class OpenReadSession_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SUCCESS = 0
+          E = 1
+
+          FIELDS = {
+            SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Blur::Session},
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Search_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+          QUERYARGS = 2
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+            QUERYARGS => {:type => ::Thrift::Types::STRUCT, :name => 'queryArgs', :class => Blur::QueryArgs}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Search_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SUCCESS = 0
+          E = 1
+
+          FIELDS = {
+            SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Blur::TopFieldDocs},
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Doc_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+          DOCLOCATIONS = 2
+          FIELDS = 4
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+            DOCLOCATIONS => {:type => ::Thrift::Types::LIST, :name => 'docLocations', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::DocLocation}},
+            FIELDS => {:type => ::Thrift::Types::SET, :name => 'fields', :element => {:type => ::Thrift::Types::STRING}}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Doc_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SUCCESS = 0
+          E = 1
+
+          FIELDS = {
+            SUCCESS => {:type => ::Thrift::Types::LIST, :name => 'success', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Document}},
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class CloseReadSession_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class CloseReadSession_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class OpenWriteSession_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          TABLE = 1
+
+          FIELDS = {
+            TABLE => {:type => ::Thrift::Types::STRING, :name => 'table'}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class OpenWriteSession_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SUCCESS = 0
+          E = 1
+
+          FIELDS = {
+            SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => Blur::Session},
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class AddDocuments_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+          SHARDINDEX = 2
+          DOCUMENT = 3
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+            SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'},
+            DOCUMENT => {:type => ::Thrift::Types::LIST, :name => 'document', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Document}}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class AddDocuments_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class DeleteDocumentsByQueries_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+          SHARDINDEX = 2
+          QUERIES = 3
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+            SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'},
+            QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::QueryArgs}}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class DeleteDocumentsByQueries_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class DeleteDocuments_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+          SHARDINDEX = 2
+          TERMS = 3
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+            SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'},
+            TERMS => {:type => ::Thrift::Types::LIST, :name => 'terms', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Term}}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class DeleteDocuments_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class UpdateDocuments_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+          SHARDINDEX = 2
+          TERMS = 3
+          DOCUMENT = 4
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session},
+            SHARDINDEX => {:type => ::Thrift::Types::I32, :name => 'shardIndex'},
+            TERMS => {:type => ::Thrift::Types::LIST, :name => 'terms', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Term}},
+            DOCUMENT => {:type => ::Thrift::Types::LIST, :name => 'document', :element => {:type => ::Thrift::Types::STRUCT, :class => Blur::Document}}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class UpdateDocuments_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Commit_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Commit_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Rollback_args
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          SESSION = 1
+
+          FIELDS = {
+            SESSION => {:type => ::Thrift::Types::STRUCT, :name => 'session', :class => Blur::Session}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+        class Rollback_result
+          include ::Thrift::Struct, ::Thrift::Struct_Union
+          E = 1
+
+          FIELDS = {
+            E => {:type => ::Thrift::Types::STRUCT, :name => 'e', :class => Blur::BlurException}
+          }
+
+          def struct_fields; FIELDS; end
+
+          def validate
+          end
+
+          ::Thrift::Struct.generate_accessors self
+        end
+
+      end
+
+    end

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/service.thrift
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/service.thrift b/src/blur-new-api-prototype/service.thrift
index 45d03b0..b7368bc 100644
--- a/src/blur-new-api-prototype/service.thrift
+++ b/src/blur-new-api-prototype/service.thrift
@@ -15,7 +15,7 @@ struct Attribute {
   3:TYPE type
 }
 
-struct Tuple {
+struct Record {
   1:list<Attribute> attributes
 }
 
@@ -29,31 +29,137 @@ struct QuerySession {
   2:string queryId
 }
 
-service BlurTuple {
+service Blur {
 
   Session openReadSession() throws (1:BlurException e)
   QuerySession executeQuery(1:Session session, 2:string query) throws (1:BlurException e)
-  list<Tuple> nextMetaDataResults(1:QuerySession session, 2:i32 batchSize) throws (1:BlurException e)
-  list<Tuple> nextResults(1:QuerySession session, 2:i32 batchSize) throws (1:BlurException e)
+  list<Record> nextMetaDataResults(1:QuerySession session, 2:i32 batchSize) throws (1:BlurException e)
+  list<Record> nextResults(1:QuerySession session, 2:i32 batchSize) throws (1:BlurException e)
   void closeReadSession(1:Session session) throws (1:BlurException e)
 
   Session openWriteSession(1:string table) throws (1:BlurException e)
-  void writeTuples(1:Session session, 2:list<Tuple> tuples) throws (1:BlurException e)
+  void writeRecords(1:Session session, 2:list<Record> records) throws (1:BlurException e)
   void commitWriteSession(1:Session session) throws (1:BlurException e)
   void rollbackWriteSession(1:Session session) throws (1:BlurException e)
   
 }
 
-service BlurShard {
+enum SortType {
+    /** Sort by document score (relevance).  Sort values are Float and higher
+     * values are at the front. */
+    SCORE,
 
-  void addReadSession(1:Session session) throws (1:BlurException e)
-  void executeQuery(1:Session session, 2:string query) throws (1:BlurException e)
-  list<Tuple> nextMetaDataResults(1:Session session, 2:i32 batchSize) throws (1:BlurException e)
-  list<Tuple> nextResults(1:Session session, 2:i32 batchSize) throws (1:BlurException e)
-  void removeReadSession(1:Session session) throws (1:BlurException e)
+    /** Sort by document number (index order).  Sort values are Integer and lower
+     * values are at the front. */
+    DOC,
 
-  void addWriteSession(1:Session session) throws (1:BlurException e)
-  void writeTuples(1:Session session, 2:list<Tuple> tuples) throws (1:BlurException e)
-  void removeWriteSession(1:Session session) throws (1:BlurException e)
+    /** Sort using term values as Strings.  Sort values are String and lower
+     * values are at the front. */
+    STRING,
+
+    /** Sort using term values as encoded Integers.  Sort values are Integer and
+     * lower values are at the front. */
+    INT,
+
+    /** Sort using term values as encoded Floats.  Sort values are Float and
+     * lower values are at the front. */
+    FLOAT,
+
+    /** Sort using term values as encoded Longs.  Sort values are Long and
+     * lower values are at the front. */
+    LONG,
+
+    /** Sort using term values as encoded Doubles.  Sort values are Double and
+     * lower values are at the front. */
+    DOUBLE,
+
+    /** Sort using term values as encoded Shorts.  Sort values are Short and
+     * lower values are at the front. */
+    SHORT,
+
+    /** Sort using term values as encoded Bytes.  Sort values are Byte and
+     * lower values are at the front. */
+    BYTE,
+
+    /** Sort using term values as Strings, but comparing by
+     * value (using String.compareTo) for all comparisons.
+     * This is typically slower than {@link #STRING}, which
+     * uses ordinals to do the sorting. */
+    STRING_VAL,
+
+    /** Sort use byte[] index values. */
+    BYTES,
+}
+
+struct SortField {
+ 1:string field,
+ 2:SortType type, 
+ 3:bool reverse
+}
+
+struct Sort {
+ 1:list<SortField> fields
+}
+
+struct DocLocation {
+ 1:i32 doc,
+ 2:i32 shardIndex
+}
+
+struct ScoreDoc {
+ 1:double score,
+ 2:DocLocation docLocation,
+ 4:list<binary> fields
+}
+
+struct QueryArgs {
+ 1:ScoreDoc after,
+ 2:binary query,
+ 3:binary filter,
+ 4:i32 numberToFetch,
+ 5:Sort sort,
+ 6:bool doDocScores,
+ 7:bool doMaxScore,
+ 8:list<i32> shardIndexes
+}
+
+struct TopFieldDocs {
+ 1:i64 totalHits,
+ 2:list<ScoreDoc> scoreDocs,
+ 3:double maxScore,
+ 4:list<SortField> fields
+}
+
+struct Field {
+  1:string name,
+  2:binary value,
+  3:TYPE type,
+  4:double boost
+}
+
+struct Document {
+ 1:list<Field> fields
+}
+
+struct Term {
+  1:string field,
+  2:binary bytes
+}
+
+service Lucene {
+
+  Session openReadSession(1:string table) throws (1:BlurException e)
+  TopFieldDocs search(1:Session session, 2:QueryArgs queryArgs) throws (1:BlurException e)
+  list<Document> doc(1:Session session, 2:list<DocLocation> docLocations, 4:set<string> fields) throws (1:BlurException e)
+  void closeReadSession(1:Session session) throws (1:BlurException e)
+  
+  Session openWriteSession(1:string table) throws (1:BlurException e)
+  void addDocuments(1:Session session, 2:i32 shardIndex, 3:list<Document> document) throws (1:BlurException e)
+  void deleteDocumentsByQueries(1:Session session, 2:i32 shardIndex, 3:list<QueryArgs> queries) throws (1:BlurException e)
+  void deleteDocuments(1:Session session, 2:i32 shardIndex, 3:list<Term> terms) throws (1:BlurException e)
+  void updateDocuments(1:Session session, 2:i32 shardIndex, 3:list<Term> terms, 4:list<Document> document) throws (1:BlurException e)
+  
+  void commit(1:Session session) throws (1:BlurException e)
+  void rollback(1:Session session) throws (1:BlurException e)
   
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ShardServer.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ShardServer.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ShardServer.java
deleted file mode 100644
index 00af1f9..0000000
--- a/src/blur-new-api-prototype/src/main/java/org/apache/blur/core/ShardServer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.blur.core;
-
-import java.util.List;
-
-import org.apache.blur.thrift.generated.*;
-import org.apache.thrift.TException;
-
-public class ShardServer implements BlurShard.Iface {
-
-  public static void main(String[] args) {
-
-  }
-
-  @Override
-  public void addReadSession(Session session) throws BlurException, TException {
-    
-  }
-
-  @Override
-  public void executeQuery(Session session, String query) throws BlurException, TException {
-    
-  }
-
-  @Override
-  public List<Tuple> nextMetaDataResults(Session session, int batchSize) throws BlurException, TException {
-    return null;
-  }
-
-  @Override
-  public List<Tuple> nextResults(Session session, int batchSize) throws BlurException, TException {
-    return null;
-  }
-
-  @Override
-  public void removeReadSession(Session session) throws BlurException, TException {
-    
-  }
-
-  @Override
-  public void addWriteSession(Session session) throws BlurException, TException {
-    
-  }
-
-  @Override
-  public void writeTuples(Session session, List<Tuple> tuples) throws BlurException, TException {
-    
-  }
-
-  @Override
-  public void removeWriteSession(Session session) throws BlurException, TException {
-    
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java
new file mode 100644
index 0000000..b089b98
--- /dev/null
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/AbtractQueryWritable.java
@@ -0,0 +1,10 @@
+package org.apache.blur.lucene.serializer;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.lucene.search.Query;
+
+public abstract class AbtractQueryWritable implements Writable {
+  
+  public abstract Query getQuery();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java
new file mode 100644
index 0000000..54cb9fc
--- /dev/null
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanClauseWritable.java
@@ -0,0 +1,71 @@
+package org.apache.blur.lucene.serializer;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanClause.Occur;
+
+public class BooleanClauseWritable implements Writable {
+
+  private BooleanClause booleanClause;
+
+  public BooleanClauseWritable() {
+
+  }
+
+  public BooleanClauseWritable(BooleanClause booleanClause) {
+    this.booleanClause = booleanClause;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    Occur occur = booleanClause.getOccur();
+    switch (occur) {
+    case MUST:
+      out.write(0);
+      break;
+    case MUST_NOT:
+      out.write(1);
+      break;
+    case SHOULD:
+      out.write(2);
+      break;
+    default:
+      throw new RuntimeException("Occur [" + occur + "] not supported");
+    }
+    new QueryWritable(booleanClause.getQuery()).write(out);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    Occur occur = null;
+    byte o = in.readByte();
+    switch (o) {
+    case 0:
+      occur = Occur.MUST;
+      break;
+    case 1:
+      occur = Occur.MUST_NOT;
+      break;
+    case 2:
+      occur = Occur.SHOULD;
+      break;
+    default:
+      throw new RuntimeException("Occur [" + o + "] not supported");
+    }
+    QueryWritable queryWritable = new QueryWritable();
+    queryWritable.readFields(in);
+    booleanClause = new BooleanClause(queryWritable.getQuery(), occur);
+  }
+
+  public BooleanClause getBooleanClause() {
+    return booleanClause;
+  }
+
+  public void setBooleanClause(BooleanClause booleanClause) {
+    this.booleanClause = booleanClause;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java
new file mode 100644
index 0000000..9cedb91
--- /dev/null
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/BooleanQueryWritable.java
@@ -0,0 +1,57 @@
+package org.apache.blur.lucene.serializer;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+import org.apache.lucene.search.BooleanClause;
+import org.apache.lucene.search.BooleanQuery;
+
+public class BooleanQueryWritable extends AbtractQueryWritable {
+
+  private BooleanQuery query;
+
+  public BooleanQuery getQuery() {
+    return query;
+  }
+
+  public void setQuery(BooleanQuery query) {
+    this.query = query;
+  }
+
+  public BooleanQueryWritable() {
+
+  }
+
+  public BooleanQueryWritable(BooleanQuery booleanQuery) {
+    this.query = booleanQuery;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeBoolean(query.isCoordDisabled());
+    out.writeFloat(query.getBoost());
+    out.writeInt(query.getMinimumNumberShouldMatch());
+    BooleanClause[] clauses = query.getClauses();
+    out.writeInt(clauses.length);
+    for (int i = 0; i < clauses.length; i++) {
+      BooleanClauseWritable booleanClauseWritable = new BooleanClauseWritable(clauses[i]);
+      booleanClauseWritable.write(out);
+    }
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    query = new BooleanQuery(in.readBoolean());
+    query.setBoost(in.readFloat());
+    query.setMinimumNumberShouldMatch(in.readInt());
+    int length = in.readInt();
+    for (int i = 0; i < length; i++) {
+      BooleanClauseWritable booleanClauseWritable = new BooleanClauseWritable();
+      booleanClauseWritable.readFields(in);
+      query.add(booleanClauseWritable.getBooleanClause());
+    }
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java
new file mode 100644
index 0000000..174746e
--- /dev/null
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/FuzzyQueryWritable.java
@@ -0,0 +1,89 @@
+package org.apache.blur.lucene.serializer;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import org.apache.lucene.index.Term;
+import org.apache.lucene.search.FuzzyQuery;
+
+public class FuzzyQueryWritable extends AbtractQueryWritable {
+
+  private FuzzyQuery query;
+  private static Field maxExpansionsField;
+  private static Field transpositionsField;
+
+  static {
+    try {
+      maxExpansionsField = FuzzyQuery.class.getDeclaredField("maxExpansions");
+      transpositionsField = FuzzyQuery.class.getDeclaredField("transpositions");
+      maxExpansionsField.setAccessible(true);
+      transpositionsField.setAccessible(true);
+    } catch (SecurityException e) {
+      throw new RuntimeException(e);
+    } catch (NoSuchFieldException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  public FuzzyQueryWritable() {
+
+  }
+
+  public FuzzyQueryWritable(FuzzyQuery query) {
+    this.query = query;
+  }
+
+  public FuzzyQuery getQuery() {
+    return query;
+  }
+
+  public void setQuery(FuzzyQuery query) {
+    this.query = query;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeFloat(query.getBoost());
+    new TermWritable(query.getTerm()).write(out);
+    out.writeInt(query.getMaxEdits());
+    out.writeInt(query.getPrefixLength());
+    out.writeInt(getMaxExpansions(query));
+    out.writeBoolean(getTranspositions(query));
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    float boost = in.readFloat();
+    TermWritable termWritable = new TermWritable();
+    termWritable.readFields(in);
+    Term term = termWritable.getTerm();
+    int maxEdits = in.readInt();
+    int prefixLength = in.readInt();
+    int maxExpansions = in.readInt();
+    boolean transpositions = in.readBoolean();
+    query = new FuzzyQuery(term, maxEdits, prefixLength, maxExpansions, transpositions);
+    query.setBoost(boost);
+  }
+
+  private static boolean getTranspositions(FuzzyQuery query) {
+    try {
+      return transpositionsField.getBoolean(query);
+    } catch (IllegalArgumentException e) {
+      throw new RuntimeException(e);
+    } catch (IllegalAccessException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  private static int getMaxExpansions(FuzzyQuery query) {
+    try {
+      return maxExpansionsField.getInt(query);
+    } catch (IllegalArgumentException e) {
+      throw new RuntimeException(e);
+    } catch (IllegalAccessException e) {
+      throw new RuntimeException(e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/1e930bbc/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java
----------------------------------------------------------------------
diff --git a/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java
new file mode 100644
index 0000000..76b0aec
--- /dev/null
+++ b/src/blur-new-api-prototype/src/main/java/org/apache/blur/lucene/serializer/ProtoSerializer.java
@@ -0,0 +1,63 @@
+package org.apache.blur.lucene.serializer;
+
+import java.io.IOException;
+
+import org.apache.hadoop.io.DataInputBuffer;
+import org.apache.hadoop.io.DataOutputBuffer;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.queryparser.classic.QueryParser;
+import org.apache.lucene.search.Query;
+import org.apache.lucene.util.Version;
+
+public class ProtoSerializer {
+
+  public static void main(String[] args) throws ParseException, IOException {
+
+    QueryParser parser = new QueryParser(Version.LUCENE_40, "", new StandardAnalyzer(Version.LUCENE_40));
+
+    Query query = parser.parse("a:v1 b:v2 c:v3~");
+
+    QueryWritable queryWritable = new QueryWritable(query);
+    DataOutputBuffer buffer = new DataOutputBuffer();
+    queryWritable.write(buffer);
+    buffer.close();
+
+    System.out.println(new String(buffer.getData(), 0, buffer.getLength()));
+
+    QueryWritable qw = new QueryWritable();
+
+    DataInputBuffer in = new DataInputBuffer();
+    in.reset(buffer.getData(), 0, buffer.getLength());
+    qw.readFields(in);
+
+    System.out.println(qw.getQuery());
+
+    while (true) {
+      run(query);
+    }
+  }
+
+  private static void run(Query query) throws IOException {
+
+    DataOutputBuffer buffer = new DataOutputBuffer();
+    DataInputBuffer in = new DataInputBuffer();
+    QueryWritable outQw = new QueryWritable();
+    QueryWritable inQw = new QueryWritable();
+
+    long s = System.nanoTime();
+    int count = 1000000;
+    for (int i = 0; i < count; i++) {
+      outQw.setQuery(query);
+      outQw.write(buffer);
+
+      in.reset(buffer.getData(), 0, buffer.getLength());
+      inQw.readFields(in);
+
+      buffer.reset();
+    }
+    long e = System.nanoTime();
+    System.out.println((e - s) / 1000000.0 / (double) count);
+    // System.out.println((e - s) / (double) count);
+  }
+}


Mime
View raw message