incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [9/9] git commit: Tons of changes to make shell work. This has uncovered some limitations in the queryargs object. Refactored to allow for different query types.
Date Mon, 31 Dec 2012 20:44:03 GMT
Updated Branches:
  refs/heads/0.2-dev 4e1ce9528 -> f92d94a9b


Tons of changes to make shell work.  This has uncovered some limitations in the queryargs object.  Refactored to allow for different query types.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/f92d94a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/f92d94a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/f92d94a9

Branch: refs/heads/0.2-dev
Commit: f92d94a9b7201fe682fadd89270b00e18d4d950c
Parents: d783db8
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Dec 31 15:42:52 2012 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Dec 31 15:42:52 2012 -0500

----------------------------------------------------------------------
 interface/Blur.thrift                              |   35 +-
 interface/gen-html/Blur.html                       |   29 +-
 interface/gen-html/index.html                      |    2 +
 .../org/apache/blur/thrift/generated/Blur.java     |   66 +-
 .../org/apache/blur/thrift/generated/Query.java    |  665 +++++++++++++++
 .../apache/blur/thrift/generated/QueryArgs.java    |   46 +-
 .../apache/blur/thrift/generated/QueryType.java    |   67 ++
 .../blur/thrift/generated/TableDescriptor.java     |  129 +++-
 interface/gen-perl/Blur/Blur.pm                    |    7 +-
 interface/gen-perl/Blur/Types.pm                   |  128 +++-
 interface/gen-rb/blur.rb                           |    2 +-
 interface/gen-rb/blur_types.rb                     |   44 +-
 .../org/apache/blur/analysis/BlurAnalyzer.java     |    3 +
 .../apache/blur/lucene/search/QueryConverter.java  |   11 +
 .../blur/lucene/search/QueryConverterImpl.java     |   36 +
 .../java/org/apache/blur/manager/IndexServer.java  |    3 +
 .../blur/manager/clusterstatus/ClusterStatus.java  |    3 +-
 .../clusterstatus/ZookeeperClusterStatus.java      |  167 +---
 .../clusterstatus/ZookeeperPathConstants.java      |   78 +-
 .../indexserver/DistributedIndexServer.java        |  168 ++---
 .../blur/manager/indexserver/LocalIndexServer.java |  207 -----
 .../blur/manager/writer/AbstractBlurIndex.java     |   50 +-
 .../org/apache/blur/manager/writer/BlurIndex.java  |    4 +-
 .../blur/manager/writer/BlurIndexReader.java       |   10 +-
 .../apache/blur/manager/writer/BlurNRTIndex.java   |  126 +--
 .../blur/manager/writer/TransactionRecorder.java   |   70 +-
 .../java/org/apache/blur/thrift/BlurServer.java    |   79 +--
 .../java/org/apache/blur/thrift/Configurable.java  |   26 +
 .../java/org/apache/blur/thrift/Configured.java    |   26 +
 .../org/apache/blur/thrift/SearchCallable.java     |   66 ++
 .../java/org/apache/blur/thrift/ShardContext.java  |   71 ++
 .../java/org/apache/blur/thrift/TableContext.java  |  176 ++++
 .../org/apache/blur/thrift/ThriftBlurServer.java   |    8 -
 .../java/org/apache/blur/utils/BlurConstants.java  |    4 +
 .../apache/blur/utils/ThriftLuceneConversion.java  |   29 +-
 .../blur/manager/writer/BlurNRTIndexTest.java      |   23 +-
 .../org/apache/blur/thrift/ITBlurClusterTest.java  |   26 +-
 .../blur/example/BlurExampleIndexReader.java       |    7 +-
 .../java/org/apache/blur/shell/AddCommand.java     |   79 ++
 .../main/java/org/apache/blur/shell/Command.java   |   97 ++-
 .../java/org/apache/blur/shell/CreateCommand.java  |  123 +++
 .../org/apache/blur/shell/CreateTableCommand.java  |   62 --
 .../org/apache/blur/shell/DescribeCommand.java     |  103 +++
 .../apache/blur/shell/DescribeTableCommand.java    |   43 -
 .../org/apache/blur/shell/DisableTableCommand.java |   57 ++
 .../blur/shell/EnableDisableTableCommand.java      |   49 --
 .../org/apache/blur/shell/EnableTableCommand.java  |   57 ++
 .../org/apache/blur/shell/GetDocumentCommand.java  |   61 ++
 .../java/org/apache/blur/shell/GetRowCommand.java  |   54 --
 .../apache/blur/shell/IndexAccessLogCommand.java   |  145 ++--
 .../org/apache/blur/shell/ListTablesCommand.java   |   18 +-
 .../src/main/java/org/apache/blur/shell/Main.java  |  219 +++---
 .../org/apache/blur/shell/MutateRowCommand.java    |   77 --
 .../java/org/apache/blur/shell/QueryCommand.java   |   70 --
 .../org/apache/blur/shell/RemoveTableCommand.java  |   16 +-
 .../org/apache/blur/shell/SchemaTableCommand.java  |   14 +-
 .../java/org/apache/blur/shell/SearchCommand.java  |   81 ++
 .../apache/blur/shell/ShardClusterListCommand.java |   42 -
 .../blur/shell/ShardServerLayoutCommand.java       |   21 +-
 .../java/org/apache/blur/shell/TableCompleter.java |   40 +
 .../org/apache/blur/shell/TableNameCompleter.java  |   14 +
 .../blur/shell/TableSingleArgumentCommand.java     |   30 +
 .../org/apache/blur/shell/TableStatsCommand.java   |   15 +-
 .../java/org/apache/blur/shell/TestingCli.java     |   42 +
 .../java/org/apache/blur/shell/UpdateCommand.java  |   79 ++
 .../org/apache/blur/testsuite/TestCreateTable.java |   41 +
 .../org/apache/blur/thrift/generated/Blur.java     |   66 +-
 .../org/apache/blur/thrift/generated/Query.java    |  665 +++++++++++++++
 .../apache/blur/thrift/generated/QueryArgs.java    |   46 +-
 .../apache/blur/thrift/generated/QueryType.java    |   67 ++
 .../blur/thrift/generated/TableDescriptor.java     |  129 +++-
 src/pom.xml                                        |    2 +-
 72 files changed, 3930 insertions(+), 1491 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/Blur.thrift
----------------------------------------------------------------------
diff --git a/interface/Blur.thrift b/interface/Blur.thrift
index 5998a0d..f88dbf2 100644
--- a/interface/Blur.thrift
+++ b/interface/Blur.thrift
@@ -313,9 +313,14 @@ struct TableDescriptor {
   6:bool readOnly = 0,
 
   /**
+   * The default field name for any field where the field name is null.
+   */
+  7:string defaultFieldName = 'body',
+
+  /**
    *compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
    */
-  7:map<string,string> properties
+  8:map<string,string> properties
 }
 
 struct Session {
@@ -339,6 +344,30 @@ struct ScoreDoc {
  4:list<binary> fields
 }
 
+enum QueryType {
+ STRING,JSON,BINARY
+}
+
+/**
+ * The Query object describes how the query is passed.  If the 
+ * type is STRING or JSON the queryString field is used.  If 
+ * the BINARY type is used the queryBinary should be used.
+ */
+struct Query {
+ /**
+  * The query type.
+  */
+ 1:QueryType type,
+ /**
+  * The query to be executed.
+  */
+ 2:string queryString,
+ /**
+  * The query to be executed.
+  */
+ 3:binary queryBinary
+}
+
 struct QueryArgs {
  /**
   * Unique id for controlling the given query.
@@ -353,7 +382,7 @@ struct QueryArgs {
  /**
   * The query to be executed.
   */
- 3:binary query,
+ 3:Query query,
  /**
   * Filter to be executed.
   */
@@ -553,7 +582,7 @@ service Blur {
    * @param options the MutateOptions provide the table name, shard index, etc.
    * @param queries the Queries that will executed and mark there resulting documents as deleted.
    */
-  list<Generation> deleteDocumentsByQueries(1:MutateOptions options, 2:list<binary> queries) throws (1:BlurException e)
+  list<Generation> deleteDocumentsByQueries(1:MutateOptions options, 2:list<Query> queries) throws (1:BlurException e)
 
   /**
    * Delete Documents to the given table in the provided shard.  If the table 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-html/Blur.html
----------------------------------------------------------------------
diff --git a/interface/gen-html/Blur.html b/interface/gen-html/Blur.html
index 38180c0..e69ab15 100644
--- a/interface/gen-html/Blur.html
+++ b/interface/gen-html/Blur.html
@@ -48,9 +48,11 @@
 <a href="Blur.html#Struct_Generation">Generation</a><br/>
 <a href="Blur.html#Struct_LiveSchema">LiveSchema</a><br/>
 <a href="Blur.html#Struct_MutateOptions">MutateOptions</a><br/>
+<a href="Blur.html#Struct_Query">Query</a><br/>
 <a href="Blur.html#Struct_QueryArgs">QueryArgs</a><br/>
 <a href="Blur.html#Enum_QueryState">QueryState</a><br/>
 <a href="Blur.html#Struct_QueryStatus">QueryStatus</a><br/>
+<a href="Blur.html#Enum_QueryType">QueryType</a><br/>
 <a href="Blur.html#Struct_ScoreDoc">ScoreDoc</a><br/>
 <a href="Blur.html#Struct_Session">Session</a><br/>
 <a href="Blur.html#Struct_ShardLayout">ShardLayout</a><br/>
@@ -102,6 +104,12 @@ The fields types.
 <tr><td><code>STRING_VAL</code></td><td><code>9</code></td></tr>
 <tr><td><code>BYTES</code></td><td><code>10</code></td></tr>
 </table></div>
+<div class="definition"><h3 id="Enum_QueryType">Enumeration: QueryType</h3>
+<br/><table class="table-bordered table-striped table-condensed">
+<tr><td><code>STRING</code></td><td><code>0</code></td></tr>
+<tr><td><code>JSON</code></td><td><code>1</code></td></tr>
+<tr><td><code>BINARY</code></td><td><code>2</code></td></tr>
+</table></div>
 <hr/><h2 id="Structs">Data structures</h2>
 <div class="definition"><h3 id="Struct_BlurException">Exception: BlurException</h3>
 <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead>
@@ -200,7 +208,9 @@ field will be used.
 <tr><td>6</td><td>readOnly</td><td><code>bool</code></td><td>This will only allow queries to be executed on the table.  The underlying implementation
 does not open the index for writing, but will refresh the index periodically.
 </td><td>default</td><td>0</td></tr>
-<tr><td>7</td><td>properties</td><td><code>map&lt;<code>string</code>, <code>string</code>&gt;</code></td><td>compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
+<tr><td>7</td><td>defaultFieldName</td><td><code>string</code></td><td>The default field name for any field where the field name is null.
+</td><td>default</td><td>"body"</td></tr>
+<tr><td>8</td><td>properties</td><td><code>map&lt;<code>string</code>, <code>string</code>&gt;</code></td><td>compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
 </td><td>default</td><td></td></tr>
 </table><br/><p/>
 <br/></div><div class="definition"><h3 id="Struct_Session">Struct: Session</h3>
@@ -220,7 +230,18 @@ does not open the index for writing, but will refresh the index periodically.
 <tr><td>1</td><td>score</td><td><code>double</code></td><td></td><td>default</td><td></td></tr>
 <tr><td>2</td><td>docLocation</td><td><code>i64</code></td><td></td><td>default</td><td></td></tr>
 <tr><td>4</td><td>fields</td><td><code>list&lt;<code>binary</code>&gt;</code></td><td></td><td>default</td><td></td></tr>
-</table><br/></div><div class="definition"><h3 id="Struct_QueryArgs">Struct: QueryArgs</h3>
+</table><br/></div><div class="definition"><h3 id="Struct_Query">Struct: Query</h3>
+<table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead>
+<tr><td>1</td><td>type</td><td><code><a href="Blur.html#Enum_QueryType">QueryType</a></code></td><td>The query type.
+</td><td>default</td><td></td></tr>
+<tr><td>2</td><td>queryString</td><td><code>string</code></td><td>The query to be executed.
+</td><td>default</td><td></td></tr>
+<tr><td>3</td><td>queryBinary</td><td><code>binary</code></td><td>The query to be executed.
+</td><td>default</td><td></td></tr>
+</table><br/>The Query object describes how the query is passed.  If the
+type is STRING or JSON the queryString field is used.  If
+the BINARY type is used the queryBinary should be used.
+<br/></div><div class="definition"><h3 id="Struct_QueryArgs">Struct: QueryArgs</h3>
 <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead>
 <tr><td>1</td><td>id</td><td><code>i64</code></td><td>Unique id for controlling the given query.
 </td><td>default</td><td></td></tr>
@@ -228,7 +249,7 @@ does not open the index for writing, but will refresh the index periodically.
 ScoreDocs are fetched.  If after is not null then the first N
 ScoreDocs are fetched that occur after the given ScoreDoc.
 </td><td>default</td><td></td></tr>
-<tr><td>3</td><td>query</td><td><code>binary</code></td><td>The query to be executed.
+<tr><td>3</td><td>query</td><td><code><a href="Blur.html#Struct_Query">Query</a></code></td><td>The query to be executed.
 </td><td>default</td><td></td></tr>
 <tr><td>4</td><td>filter</td><td><code>binary</code></td><td>Filter to be executed.
 </td><td>default</td><td></td></tr>
@@ -353,7 +374,7 @@ shard is not found on this shard server a BlurException will be thrown.
 provided to be indexed in a single segment.
 <br/></div><div class="definition"><h4 id="Fn_Blur_deleteDocumentsByQueries">Function: Blur.deleteDocumentsByQueries</h4>
 <pre><code>list&lt;<code><a href="Blur.html#Struct_Generation">Generation</a></code>&gt;</code> deleteDocumentsByQueries(<code><a href="Blur.html#Struct_MutateOptions">MutateOptions</a></code> options,
-                                          <code>list&lt;<code>binary</code>&gt;</code> queries)
+                                          <code>list&lt;<code><a href="Blur.html#Struct_Query">Query</a></code>&gt;</code> queries)
     throws <code><a href="Blur.html#Struct_BlurException">BlurException</a></code>
 </pre>Delete Documents to the given table in the provided shard.  If the table
 or shard is not found on this shard server a BlurException will be thrown.

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-html/index.html
----------------------------------------------------------------------
diff --git a/interface/gen-html/index.html b/interface/gen-html/index.html
index 82cfa48..45d5a40 100644
--- a/interface/gen-html/index.html
+++ b/interface/gen-html/index.html
@@ -44,9 +44,11 @@
 <a href="Blur.html#Struct_Generation">Generation</a><br/>
 <a href="Blur.html#Struct_LiveSchema">LiveSchema</a><br/>
 <a href="Blur.html#Struct_MutateOptions">MutateOptions</a><br/>
+<a href="Blur.html#Struct_Query">Query</a><br/>
 <a href="Blur.html#Struct_QueryArgs">QueryArgs</a><br/>
 <a href="Blur.html#Enum_QueryState">QueryState</a><br/>
 <a href="Blur.html#Struct_QueryStatus">QueryStatus</a><br/>
+<a href="Blur.html#Enum_QueryType">QueryType</a><br/>
 <a href="Blur.html#Struct_ScoreDoc">ScoreDoc</a><br/>
 <a href="Blur.html#Struct_Session">Session</a><br/>
 <a href="Blur.html#Struct_ShardLayout">ShardLayout</a><br/>

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-java/org/apache/blur/thrift/generated/Blur.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/Blur.java b/interface/gen-java/org/apache/blur/thrift/generated/Blur.java
index 6a3527a..1ebd02e 100644
--- a/interface/gen-java/org/apache/blur/thrift/generated/Blur.java
+++ b/interface/gen-java/org/apache/blur/thrift/generated/Blur.java
@@ -117,7 +117,7 @@ public class Blur {
      * @param options
      * @param queries
      */
-    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries) throws BlurException, org.apache.thrift.TException;
+    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<Query> queries) throws BlurException, org.apache.thrift.TException;
 
     /**
      * Delete Documents to the given table in the provided shard.  If the table
@@ -282,7 +282,7 @@ public class Blur {
 
     public void addDocuments(MutateOptions options, List<Document> documents, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addDocuments_call> resultHandler) throws org.apache.thrift.TException;
 
-    public void deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException;
+    public void deleteDocumentsByQueries(MutateOptions options, List<Query> queries, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException;
 
     public void deleteDocuments(MutateOptions options, List<Term> terms, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteDocuments_call> resultHandler) throws org.apache.thrift.TException;
 
@@ -473,13 +473,13 @@ public class Blur {
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addDocuments failed: unknown result");
     }
 
-    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries) throws BlurException, org.apache.thrift.TException
+    public List<Generation> deleteDocumentsByQueries(MutateOptions options, List<Query> queries) throws BlurException, org.apache.thrift.TException
     {
       send_deleteDocumentsByQueries(options, queries);
       return recv_deleteDocumentsByQueries();
     }
 
-    public void send_deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries) throws org.apache.thrift.TException
+    public void send_deleteDocumentsByQueries(MutateOptions options, List<Query> queries) throws org.apache.thrift.TException
     {
       deleteDocumentsByQueries_args args = new deleteDocumentsByQueries_args();
       args.setOptions(options);
@@ -1144,7 +1144,7 @@ public class Blur {
       }
     }
 
-    public void deleteDocumentsByQueries(MutateOptions options, List<ByteBuffer> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException {
+    public void deleteDocumentsByQueries(MutateOptions options, List<Query> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler) throws org.apache.thrift.TException {
       checkReady();
       deleteDocumentsByQueries_call method_call = new deleteDocumentsByQueries_call(options, queries, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
@@ -1153,8 +1153,8 @@ public class Blur {
 
     public static class deleteDocumentsByQueries_call extends org.apache.thrift.async.TAsyncMethodCall {
       private MutateOptions options;
-      private List<ByteBuffer> queries;
-      public deleteDocumentsByQueries_call(MutateOptions options, List<ByteBuffer> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      private List<Query> queries;
+      public deleteDocumentsByQueries_call(MutateOptions options, List<Query> queries, org.apache.thrift.async.AsyncMethodCallback<deleteDocumentsByQueries_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.options = options;
         this.queries = queries;
@@ -7099,7 +7099,7 @@ public class Blur {
     }
 
     public MutateOptions options; // required
-    public List<ByteBuffer> queries; // required
+    public List<Query> queries; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -7170,7 +7170,7 @@ public class Blur {
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MutateOptions.class)));
       tmpMap.put(_Fields.QUERIES, new org.apache.thrift.meta_data.FieldMetaData("queries", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
-              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING              , true))));
+              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Query.class))));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteDocumentsByQueries_args.class, metaDataMap);
     }
@@ -7180,7 +7180,7 @@ public class Blur {
 
     public deleteDocumentsByQueries_args(
       MutateOptions options,
-      List<ByteBuffer> queries)
+      List<Query> queries)
     {
       this();
       this.options = options;
@@ -7195,11 +7195,9 @@ public class Blur {
         this.options = new MutateOptions(other.options);
       }
       if (other.isSetQueries()) {
-        List<ByteBuffer> __this__queries = new ArrayList<ByteBuffer>();
-        for (ByteBuffer other_element : other.queries) {
-          ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element);
-;
-          __this__queries.add(temp_binary_element);
+        List<Query> __this__queries = new ArrayList<Query>();
+        for (Query other_element : other.queries) {
+          __this__queries.add(new Query(other_element));
         }
         this.queries = __this__queries;
       }
@@ -7243,22 +7241,22 @@ public class Blur {
       return (this.queries == null) ? 0 : this.queries.size();
     }
 
-    public java.util.Iterator<ByteBuffer> getQueriesIterator() {
+    public java.util.Iterator<Query> getQueriesIterator() {
       return (this.queries == null) ? null : this.queries.iterator();
     }
 
-    public void addToQueries(ByteBuffer elem) {
+    public void addToQueries(Query elem) {
       if (this.queries == null) {
-        this.queries = new ArrayList<ByteBuffer>();
+        this.queries = new ArrayList<Query>();
       }
       this.queries.add(elem);
     }
 
-    public List<ByteBuffer> getQueries() {
+    public List<Query> getQueries() {
       return this.queries;
     }
 
-    public deleteDocumentsByQueries_args setQueries(List<ByteBuffer> queries) {
+    public deleteDocumentsByQueries_args setQueries(List<Query> queries) {
       this.queries = queries;
       return this;
     }
@@ -7292,7 +7290,7 @@ public class Blur {
         if (value == null) {
           unsetQueries();
         } else {
-          setQueries((List<ByteBuffer>)value);
+          setQueries((List<Query>)value);
         }
         break;
 
@@ -7487,11 +7485,12 @@ public class Blur {
               if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                 {
                   org.apache.thrift.protocol.TList _list176 = iprot.readListBegin();
-                  struct.queries = new ArrayList<ByteBuffer>(_list176.size);
+                  struct.queries = new ArrayList<Query>(_list176.size);
                   for (int _i177 = 0; _i177 < _list176.size; ++_i177)
                   {
-                    ByteBuffer _elem178; // required
-                    _elem178 = iprot.readBinary();
+                    Query _elem178; // required
+                    _elem178 = new Query();
+                    _elem178.read(iprot);
                     struct.queries.add(_elem178);
                   }
                   iprot.readListEnd();
@@ -7524,10 +7523,10 @@ public class Blur {
         if (struct.queries != null) {
           oprot.writeFieldBegin(QUERIES_FIELD_DESC);
           {
-            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.queries.size()));
-            for (ByteBuffer _iter179 : struct.queries)
+            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.queries.size()));
+            for (Query _iter179 : struct.queries)
             {
-              oprot.writeBinary(_iter179);
+              _iter179.write(oprot);
             }
             oprot.writeListEnd();
           }
@@ -7564,9 +7563,9 @@ public class Blur {
         if (struct.isSetQueries()) {
           {
             oprot.writeI32(struct.queries.size());
-            for (ByteBuffer _iter180 : struct.queries)
+            for (Query _iter180 : struct.queries)
             {
-              oprot.writeBinary(_iter180);
+              _iter180.write(oprot);
             }
           }
         }
@@ -7583,12 +7582,13 @@ public class Blur {
         }
         if (incoming.get(1)) {
           {
-            org.apache.thrift.protocol.TList _list181 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
-            struct.queries = new ArrayList<ByteBuffer>(_list181.size);
+            org.apache.thrift.protocol.TList _list181 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+            struct.queries = new ArrayList<Query>(_list181.size);
             for (int _i182 = 0; _i182 < _list181.size; ++_i182)
             {
-              ByteBuffer _elem183; // required
-              _elem183 = iprot.readBinary();
+              Query _elem183; // required
+              _elem183 = new Query();
+              _elem183.read(iprot);
               struct.queries.add(_elem183);
             }
           }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-java/org/apache/blur/thrift/generated/Query.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/Query.java b/interface/gen-java/org/apache/blur/thrift/generated/Query.java
new file mode 100644
index 0000000..afa8ba5
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/Query.java
@@ -0,0 +1,665 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Query object describes how the query is passed.  If the
+ * type is STRING or JSON the queryString field is used.  If
+ * the BINARY type is used the queryBinary should be used.
+ */
+public class Query implements org.apache.thrift.TBase<Query, Query._Fields>, java.io.Serializable, Cloneable {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Query");
+
+  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
+  private static final org.apache.thrift.protocol.TField QUERY_STRING_FIELD_DESC = new org.apache.thrift.protocol.TField("queryString", org.apache.thrift.protocol.TType.STRING, (short)2);
+  private static final org.apache.thrift.protocol.TField QUERY_BINARY_FIELD_DESC = new org.apache.thrift.protocol.TField("queryBinary", org.apache.thrift.protocol.TType.STRING, (short)3);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new QueryStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new QueryTupleSchemeFactory());
+  }
+
+  /**
+   * The query type.
+   * 
+   * @see QueryType
+   */
+  public QueryType type; // required
+  /**
+   * The query to be executed.
+   */
+  public String queryString; // required
+  /**
+   * The query to be executed.
+   */
+  public ByteBuffer queryBinary; // required
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    /**
+     * The query type.
+     * 
+     * @see QueryType
+     */
+    TYPE((short)1, "type"),
+    /**
+     * The query to be executed.
+     */
+    QUERY_STRING((short)2, "queryString"),
+    /**
+     * The query to be executed.
+     */
+    QUERY_BINARY((short)3, "queryBinary");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // TYPE
+          return TYPE;
+        case 2: // QUERY_STRING
+          return QUERY_STRING;
+        case 3: // QUERY_BINARY
+          return QUERY_BINARY;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, QueryType.class)));
+    tmpMap.put(_Fields.QUERY_STRING, new org.apache.thrift.meta_data.FieldMetaData("queryString", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.QUERY_BINARY, new org.apache.thrift.meta_data.FieldMetaData("queryBinary", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
+    metaDataMap = Collections.unmodifiableMap(tmpMap);
+    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Query.class, metaDataMap);
+  }
+
+  public Query() {
+  }
+
+  public Query(
+    QueryType type,
+    String queryString,
+    ByteBuffer queryBinary)
+  {
+    this();
+    this.type = type;
+    this.queryString = queryString;
+    this.queryBinary = queryBinary;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public Query(Query other) {
+    if (other.isSetType()) {
+      this.type = other.type;
+    }
+    if (other.isSetQueryString()) {
+      this.queryString = other.queryString;
+    }
+    if (other.isSetQueryBinary()) {
+      this.queryBinary = org.apache.thrift.TBaseHelper.copyBinary(other.queryBinary);
+;
+    }
+  }
+
+  public Query deepCopy() {
+    return new Query(this);
+  }
+
+  @Override
+  public void clear() {
+    this.type = null;
+    this.queryString = null;
+    this.queryBinary = null;
+  }
+
+  /**
+   * The query type.
+   * 
+   * @see QueryType
+   */
+  public QueryType getType() {
+    return this.type;
+  }
+
+  /**
+   * The query type.
+   * 
+   * @see QueryType
+   */
+  public Query setType(QueryType type) {
+    this.type = type;
+    return this;
+  }
+
+  public void unsetType() {
+    this.type = null;
+  }
+
+  /** Returns true if field type is set (has been assigned a value) and false otherwise */
+  public boolean isSetType() {
+    return this.type != null;
+  }
+
+  public void setTypeIsSet(boolean value) {
+    if (!value) {
+      this.type = null;
+    }
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public String getQueryString() {
+    return this.queryString;
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public Query setQueryString(String queryString) {
+    this.queryString = queryString;
+    return this;
+  }
+
+  public void unsetQueryString() {
+    this.queryString = null;
+  }
+
+  /** Returns true if field queryString is set (has been assigned a value) and false otherwise */
+  public boolean isSetQueryString() {
+    return this.queryString != null;
+  }
+
+  public void setQueryStringIsSet(boolean value) {
+    if (!value) {
+      this.queryString = null;
+    }
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public byte[] getQueryBinary() {
+    setQueryBinary(org.apache.thrift.TBaseHelper.rightSize(queryBinary));
+    return queryBinary == null ? null : queryBinary.array();
+  }
+
+  public ByteBuffer bufferForQueryBinary() {
+    return queryBinary;
+  }
+
+  /**
+   * The query to be executed.
+   */
+  public Query setQueryBinary(byte[] queryBinary) {
+    setQueryBinary(queryBinary == null ? (ByteBuffer)null : ByteBuffer.wrap(queryBinary));
+    return this;
+  }
+
+  public Query setQueryBinary(ByteBuffer queryBinary) {
+    this.queryBinary = queryBinary;
+    return this;
+  }
+
+  public void unsetQueryBinary() {
+    this.queryBinary = null;
+  }
+
+  /** Returns true if field queryBinary is set (has been assigned a value) and false otherwise */
+  public boolean isSetQueryBinary() {
+    return this.queryBinary != null;
+  }
+
+  public void setQueryBinaryIsSet(boolean value) {
+    if (!value) {
+      this.queryBinary = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case TYPE:
+      if (value == null) {
+        unsetType();
+      } else {
+        setType((QueryType)value);
+      }
+      break;
+
+    case QUERY_STRING:
+      if (value == null) {
+        unsetQueryString();
+      } else {
+        setQueryString((String)value);
+      }
+      break;
+
+    case QUERY_BINARY:
+      if (value == null) {
+        unsetQueryBinary();
+      } else {
+        setQueryBinary((ByteBuffer)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case TYPE:
+      return getType();
+
+    case QUERY_STRING:
+      return getQueryString();
+
+    case QUERY_BINARY:
+      return getQueryBinary();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case TYPE:
+      return isSetType();
+    case QUERY_STRING:
+      return isSetQueryString();
+    case QUERY_BINARY:
+      return isSetQueryBinary();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof Query)
+      return this.equals((Query)that);
+    return false;
+  }
+
+  public boolean equals(Query that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_type = true && this.isSetType();
+    boolean that_present_type = true && that.isSetType();
+    if (this_present_type || that_present_type) {
+      if (!(this_present_type && that_present_type))
+        return false;
+      if (!this.type.equals(that.type))
+        return false;
+    }
+
+    boolean this_present_queryString = true && this.isSetQueryString();
+    boolean that_present_queryString = true && that.isSetQueryString();
+    if (this_present_queryString || that_present_queryString) {
+      if (!(this_present_queryString && that_present_queryString))
+        return false;
+      if (!this.queryString.equals(that.queryString))
+        return false;
+    }
+
+    boolean this_present_queryBinary = true && this.isSetQueryBinary();
+    boolean that_present_queryBinary = true && that.isSetQueryBinary();
+    if (this_present_queryBinary || that_present_queryBinary) {
+      if (!(this_present_queryBinary && that_present_queryBinary))
+        return false;
+      if (!this.queryBinary.equals(that.queryBinary))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    return 0;
+  }
+
+  public int compareTo(Query other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+    Query typedOther = (Query)other;
+
+    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetType()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetQueryString()).compareTo(typedOther.isSetQueryString());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetQueryString()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryString, typedOther.queryString);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetQueryBinary()).compareTo(typedOther.isSetQueryBinary());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetQueryBinary()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryBinary, typedOther.queryBinary);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("Query(");
+    boolean first = true;
+
+    sb.append("type:");
+    if (this.type == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.type);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("queryString:");
+    if (this.queryString == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.queryString);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("queryBinary:");
+    if (this.queryBinary == null) {
+      sb.append("null");
+    } else {
+      org.apache.thrift.TBaseHelper.toString(this.queryBinary, sb);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class QueryStandardSchemeFactory implements SchemeFactory {
+    public QueryStandardScheme getScheme() {
+      return new QueryStandardScheme();
+    }
+  }
+
+  private static class QueryStandardScheme extends StandardScheme<Query> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, Query struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // TYPE
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.type = QueryType.findByValue(iprot.readI32());
+              struct.setTypeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 2: // QUERY_STRING
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.queryString = iprot.readString();
+              struct.setQueryStringIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // QUERY_BINARY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.queryBinary = iprot.readBinary();
+              struct.setQueryBinaryIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, Query struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.type != null) {
+        oprot.writeFieldBegin(TYPE_FIELD_DESC);
+        oprot.writeI32(struct.type.getValue());
+        oprot.writeFieldEnd();
+      }
+      if (struct.queryString != null) {
+        oprot.writeFieldBegin(QUERY_STRING_FIELD_DESC);
+        oprot.writeString(struct.queryString);
+        oprot.writeFieldEnd();
+      }
+      if (struct.queryBinary != null) {
+        oprot.writeFieldBegin(QUERY_BINARY_FIELD_DESC);
+        oprot.writeBinary(struct.queryBinary);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class QueryTupleSchemeFactory implements SchemeFactory {
+    public QueryTupleScheme getScheme() {
+      return new QueryTupleScheme();
+    }
+  }
+
+  private static class QueryTupleScheme extends TupleScheme<Query> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, Query struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      BitSet optionals = new BitSet();
+      if (struct.isSetType()) {
+        optionals.set(0);
+      }
+      if (struct.isSetQueryString()) {
+        optionals.set(1);
+      }
+      if (struct.isSetQueryBinary()) {
+        optionals.set(2);
+      }
+      oprot.writeBitSet(optionals, 3);
+      if (struct.isSetType()) {
+        oprot.writeI32(struct.type.getValue());
+      }
+      if (struct.isSetQueryString()) {
+        oprot.writeString(struct.queryString);
+      }
+      if (struct.isSetQueryBinary()) {
+        oprot.writeBinary(struct.queryBinary);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, Query struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      BitSet incoming = iprot.readBitSet(3);
+      if (incoming.get(0)) {
+        struct.type = QueryType.findByValue(iprot.readI32());
+        struct.setTypeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.queryString = iprot.readString();
+        struct.setQueryStringIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.queryBinary = iprot.readBinary();
+        struct.setQueryBinaryIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java b/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
index 3746dd8..46451f0 100644
--- a/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
+++ b/interface/gen-java/org/apache/blur/thrift/generated/QueryArgs.java
@@ -54,7 +54,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
 
   private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
   private static final org.apache.thrift.protocol.TField AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("after", org.apache.thrift.protocol.TType.STRUCT, (short)2);
-  private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("query", org.apache.thrift.protocol.TType.STRUCT, (short)3);
   private static final org.apache.thrift.protocol.TField FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("filter", org.apache.thrift.protocol.TType.STRING, (short)4);
   private static final org.apache.thrift.protocol.TField NUMBER_TO_FETCH_FIELD_DESC = new org.apache.thrift.protocol.TField("numberToFetch", org.apache.thrift.protocol.TType.I32, (short)5);
   private static final org.apache.thrift.protocol.TField AGGREGATE_RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("aggregateResults", org.apache.thrift.protocol.TType.BOOL, (short)6);
@@ -82,7 +82,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   /**
    * The query to be executed.
    */
-  public ByteBuffer query; // required
+  public Query query; // required
   /**
    * Filter to be executed.
    */
@@ -252,7 +252,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     tmpMap.put(_Fields.AFTER, new org.apache.thrift.meta_data.FieldMetaData("after", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ScoreDoc.class)));
     tmpMap.put(_Fields.QUERY, new org.apache.thrift.meta_data.FieldMetaData("query", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
+        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Query.class)));
     tmpMap.put(_Fields.FILTER, new org.apache.thrift.meta_data.FieldMetaData("filter", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
     tmpMap.put(_Fields.NUMBER_TO_FETCH, new org.apache.thrift.meta_data.FieldMetaData("numberToFetch", org.apache.thrift.TFieldRequirementType.DEFAULT, 
@@ -286,7 +286,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   public QueryArgs(
     long id,
     ScoreDoc after,
-    ByteBuffer query,
+    Query query,
     ByteBuffer filter,
     int numberToFetch,
     boolean aggregateResults,
@@ -323,8 +323,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       this.after = new ScoreDoc(other.after);
     }
     if (other.isSetQuery()) {
-      this.query = org.apache.thrift.TBaseHelper.copyBinary(other.query);
-;
+      this.query = new Query(other.query);
     }
     if (other.isSetFilter()) {
       this.filter = org.apache.thrift.TBaseHelper.copyBinary(other.filter);
@@ -435,24 +434,14 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
   /**
    * The query to be executed.
    */
-  public byte[] getQuery() {
-    setQuery(org.apache.thrift.TBaseHelper.rightSize(query));
-    return query == null ? null : query.array();
-  }
-
-  public ByteBuffer bufferForQuery() {
-    return query;
+  public Query getQuery() {
+    return this.query;
   }
 
   /**
    * The query to be executed.
    */
-  public QueryArgs setQuery(byte[] query) {
-    setQuery(query == null ? (ByteBuffer)null : ByteBuffer.wrap(query));
-    return this;
-  }
-
-  public QueryArgs setQuery(ByteBuffer query) {
+  public QueryArgs setQuery(Query query) {
     this.query = query;
     return this;
   }
@@ -733,7 +722,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       if (value == null) {
         unsetQuery();
       } else {
-        setQuery((ByteBuffer)value);
+        setQuery((Query)value);
       }
       break;
 
@@ -1118,7 +1107,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     if (this.query == null) {
       sb.append("null");
     } else {
-      org.apache.thrift.TBaseHelper.toString(this.query, sb);
+      sb.append(this.query);
     }
     first = false;
     if (!first) sb.append(", ");
@@ -1171,6 +1160,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
     if (after != null) {
       after.validate();
     }
+    if (query != null) {
+      query.validate();
+    }
     if (sort != null) {
       sort.validate();
     }
@@ -1230,8 +1222,9 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
             }
             break;
           case 3: // QUERY
-            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
-              struct.query = iprot.readBinary();
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+              struct.query = new Query();
+              struct.query.read(iprot);
               struct.setQueryIsSet(true);
             } else { 
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
@@ -1329,7 +1322,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
       }
       if (struct.query != null) {
         oprot.writeFieldBegin(QUERY_FIELD_DESC);
-        oprot.writeBinary(struct.query);
+        struct.query.write(oprot);
         oprot.writeFieldEnd();
       }
       if (struct.filter != null) {
@@ -1422,7 +1415,7 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         struct.after.write(oprot);
       }
       if (struct.isSetQuery()) {
-        oprot.writeBinary(struct.query);
+        struct.query.write(oprot);
       }
       if (struct.isSetFilter()) {
         oprot.writeBinary(struct.filter);
@@ -1467,7 +1460,8 @@ public class QueryArgs implements org.apache.thrift.TBase<QueryArgs, QueryArgs._
         struct.setAfterIsSet(true);
       }
       if (incoming.get(2)) {
-        struct.query = iprot.readBinary();
+        struct.query = new Query();
+        struct.query.read(iprot);
         struct.setQueryIsSet(true);
       }
       if (incoming.get(3)) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-java/org/apache/blur/thrift/generated/QueryType.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/QueryType.java b/interface/gen-java/org/apache/blur/thrift/generated/QueryType.java
new file mode 100644
index 0000000..c8c83fe
--- /dev/null
+++ b/interface/gen-java/org/apache/blur/thrift/generated/QueryType.java
@@ -0,0 +1,67 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.blur.thrift.generated;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum QueryType implements org.apache.thrift.TEnum {
+  STRING(0),
+  JSON(1),
+  BINARY(2);
+
+  private final int value;
+
+  private QueryType(int value) {
+    this.value = value;
+  }
+
+  /**
+   * Get the integer value of this enum value, as defined in the Thrift IDL.
+   */
+  public int getValue() {
+    return value;
+  }
+
+  /**
+   * Find a the enum type by its integer value, as defined in the Thrift IDL.
+   * @return null if the value is not found.
+   */
+  public static QueryType findByValue(int value) { 
+    switch (value) {
+      case 0:
+        return STRING;
+      case 1:
+        return JSON;
+      case 2:
+        return BINARY;
+      default:
+        return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-java/org/apache/blur/thrift/generated/TableDescriptor.java
----------------------------------------------------------------------
diff --git a/interface/gen-java/org/apache/blur/thrift/generated/TableDescriptor.java b/interface/gen-java/org/apache/blur/thrift/generated/TableDescriptor.java
index 0202abf..0776df6 100644
--- a/interface/gen-java/org/apache/blur/thrift/generated/TableDescriptor.java
+++ b/interface/gen-java/org/apache/blur/thrift/generated/TableDescriptor.java
@@ -61,7 +61,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
   private static final org.apache.thrift.protocol.TField STORAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("storagePath", org.apache.thrift.protocol.TType.STRING, (short)4);
   private static final org.apache.thrift.protocol.TField ANALYZER_FIELD_DESC = new org.apache.thrift.protocol.TField("analyzer", org.apache.thrift.protocol.TType.STRUCT, (short)5);
   private static final org.apache.thrift.protocol.TField READ_ONLY_FIELD_DESC = new org.apache.thrift.protocol.TField("readOnly", org.apache.thrift.protocol.TType.BOOL, (short)6);
-  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)7);
+  private static final org.apache.thrift.protocol.TField DEFAULT_FIELD_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultFieldName", org.apache.thrift.protocol.TType.STRING, (short)7);
+  private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("properties", org.apache.thrift.protocol.TType.MAP, (short)8);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -97,6 +98,10 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
    */
   public boolean readOnly; // required
   /**
+   * The default field name for any field where the field name is null.
+   */
+  public String defaultFieldName; // required
+  /**
    * compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
    */
   public Map<String,String> properties; // required
@@ -131,9 +136,13 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
      */
     READ_ONLY((short)6, "readOnly"),
     /**
+     * The default field name for any field where the field name is null.
+     */
+    DEFAULT_FIELD_NAME((short)7, "defaultFieldName"),
+    /**
      * compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
      */
-    PROPERTIES((short)7, "properties");
+    PROPERTIES((short)8, "properties");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -160,7 +169,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
           return ANALYZER;
         case 6: // READ_ONLY
           return READ_ONLY;
-        case 7: // PROPERTIES
+        case 7: // DEFAULT_FIELD_NAME
+          return DEFAULT_FIELD_NAME;
+        case 8: // PROPERTIES
           return PROPERTIES;
         default:
           return null;
@@ -221,6 +232,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Analyzer.class)));
     tmpMap.put(_Fields.READ_ONLY, new org.apache.thrift.meta_data.FieldMetaData("readOnly", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+    tmpMap.put(_Fields.DEFAULT_FIELD_NAME, new org.apache.thrift.meta_data.FieldMetaData("defaultFieldName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("properties", org.apache.thrift.TFieldRequirementType.DEFAULT, 
         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
@@ -236,6 +249,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
 
     this.readOnly = false;
 
+    this.defaultFieldName = "body";
+
   }
 
   public TableDescriptor(
@@ -245,6 +260,7 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     String storagePath,
     Analyzer analyzer,
     boolean readOnly,
+    String defaultFieldName,
     Map<String,String> properties)
   {
     this();
@@ -257,6 +273,7 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     this.analyzer = analyzer;
     this.readOnly = readOnly;
     setReadOnlyIsSet(true);
+    this.defaultFieldName = defaultFieldName;
     this.properties = properties;
   }
 
@@ -277,6 +294,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       this.analyzer = new Analyzer(other.analyzer);
     }
     this.readOnly = other.readOnly;
+    if (other.isSetDefaultFieldName()) {
+      this.defaultFieldName = other.defaultFieldName;
+    }
     if (other.isSetProperties()) {
       Map<String,String> __this__properties = new HashMap<String,String>();
       for (Map.Entry<String, String> other_element : other.properties.entrySet()) {
@@ -309,6 +329,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     this.analyzer = null;
     this.readOnly = false;
 
+    this.defaultFieldName = "body";
+
     this.properties = null;
   }
 
@@ -495,6 +517,36 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __READONLY_ISSET_ID, value);
   }
 
+  /**
+   * The default field name for any field where the field name is null.
+   */
+  public String getDefaultFieldName() {
+    return this.defaultFieldName;
+  }
+
+  /**
+   * The default field name for any field where the field name is null.
+   */
+  public TableDescriptor setDefaultFieldName(String defaultFieldName) {
+    this.defaultFieldName = defaultFieldName;
+    return this;
+  }
+
+  public void unsetDefaultFieldName() {
+    this.defaultFieldName = null;
+  }
+
+  /** Returns true if field defaultFieldName is set (has been assigned a value) and false otherwise */
+  public boolean isSetDefaultFieldName() {
+    return this.defaultFieldName != null;
+  }
+
+  public void setDefaultFieldNameIsSet(boolean value) {
+    if (!value) {
+      this.defaultFieldName = null;
+    }
+  }
+
   public int getPropertiesSize() {
     return (this.properties == null) ? 0 : this.properties.size();
   }
@@ -586,6 +638,14 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       }
       break;
 
+    case DEFAULT_FIELD_NAME:
+      if (value == null) {
+        unsetDefaultFieldName();
+      } else {
+        setDefaultFieldName((String)value);
+      }
+      break;
+
     case PROPERTIES:
       if (value == null) {
         unsetProperties();
@@ -617,6 +677,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     case READ_ONLY:
       return Boolean.valueOf(isReadOnly());
 
+    case DEFAULT_FIELD_NAME:
+      return getDefaultFieldName();
+
     case PROPERTIES:
       return getProperties();
 
@@ -643,6 +706,8 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       return isSetAnalyzer();
     case READ_ONLY:
       return isSetReadOnly();
+    case DEFAULT_FIELD_NAME:
+      return isSetDefaultFieldName();
     case PROPERTIES:
       return isSetProperties();
     }
@@ -716,6 +781,15 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         return false;
     }
 
+    boolean this_present_defaultFieldName = true && this.isSetDefaultFieldName();
+    boolean that_present_defaultFieldName = true && that.isSetDefaultFieldName();
+    if (this_present_defaultFieldName || that_present_defaultFieldName) {
+      if (!(this_present_defaultFieldName && that_present_defaultFieldName))
+        return false;
+      if (!this.defaultFieldName.equals(that.defaultFieldName))
+        return false;
+    }
+
     boolean this_present_properties = true && this.isSetProperties();
     boolean that_present_properties = true && that.isSetProperties();
     if (this_present_properties || that_present_properties) {
@@ -801,6 +875,16 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetDefaultFieldName()).compareTo(typedOther.isSetDefaultFieldName());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetDefaultFieldName()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defaultFieldName, typedOther.defaultFieldName);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetProperties()).compareTo(typedOther.isSetProperties());
     if (lastComparison != 0) {
       return lastComparison;
@@ -867,6 +951,14 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     sb.append(this.readOnly);
     first = false;
     if (!first) sb.append(", ");
+    sb.append("defaultFieldName:");
+    if (this.defaultFieldName == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.defaultFieldName);
+    }
+    first = false;
+    if (!first) sb.append(", ");
     sb.append("properties:");
     if (this.properties == null) {
       sb.append("null");
@@ -971,7 +1063,15 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 7: // PROPERTIES
+          case 7: // DEFAULT_FIELD_NAME
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.defaultFieldName = iprot.readString();
+              struct.setDefaultFieldNameIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 8: // PROPERTIES
             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
               {
                 org.apache.thrift.protocol.TMap _map54 = iprot.readMapBegin();
@@ -1030,6 +1130,11 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       oprot.writeFieldBegin(READ_ONLY_FIELD_DESC);
       oprot.writeBool(struct.readOnly);
       oprot.writeFieldEnd();
+      if (struct.defaultFieldName != null) {
+        oprot.writeFieldBegin(DEFAULT_FIELD_NAME_FIELD_DESC);
+        oprot.writeString(struct.defaultFieldName);
+        oprot.writeFieldEnd();
+      }
       if (struct.properties != null) {
         oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
         {
@@ -1079,10 +1184,13 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       if (struct.isSetReadOnly()) {
         optionals.set(5);
       }
-      if (struct.isSetProperties()) {
+      if (struct.isSetDefaultFieldName()) {
         optionals.set(6);
       }
-      oprot.writeBitSet(optionals, 7);
+      if (struct.isSetProperties()) {
+        optionals.set(7);
+      }
+      oprot.writeBitSet(optionals, 8);
       if (struct.isSetName()) {
         oprot.writeString(struct.name);
       }
@@ -1101,6 +1209,9 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
       if (struct.isSetReadOnly()) {
         oprot.writeBool(struct.readOnly);
       }
+      if (struct.isSetDefaultFieldName()) {
+        oprot.writeString(struct.defaultFieldName);
+      }
       if (struct.isSetProperties()) {
         {
           oprot.writeI32(struct.properties.size());
@@ -1116,7 +1227,7 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, TableDescriptor struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(7);
+      BitSet incoming = iprot.readBitSet(8);
       if (incoming.get(0)) {
         struct.name = iprot.readString();
         struct.setNameIsSet(true);
@@ -1143,6 +1254,10 @@ public class TableDescriptor implements org.apache.thrift.TBase<TableDescriptor,
         struct.setReadOnlyIsSet(true);
       }
       if (incoming.get(6)) {
+        struct.defaultFieldName = iprot.readString();
+        struct.setDefaultFieldNameIsSet(true);
+      }
+      if (incoming.get(7)) {
         {
           org.apache.thrift.protocol.TMap _map60 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
           struct.properties = new HashMap<String,String>(2*_map60.size);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-perl/Blur/Blur.pm
----------------------------------------------------------------------
diff --git a/interface/gen-perl/Blur/Blur.pm b/interface/gen-perl/Blur/Blur.pm
index 339a8c5..a87ba8c 100644
--- a/interface/gen-perl/Blur/Blur.pm
+++ b/interface/gen-perl/Blur/Blur.pm
@@ -969,7 +969,8 @@ sub read {
           for (my $_i159 = 0; $_i159 < $_size155; ++$_i159)
           {
             my $elem160 = undef;
-            $xfer += $input->readString(\$elem160);
+            $elem160 = new Blur::Query();
+            $xfer += $elem160->read($input);
             push(@{$self->{queries}},$elem160);
           }
           $xfer += $input->readListEnd();
@@ -998,11 +999,11 @@ sub write {
   if (defined $self->{queries}) {
     $xfer += $output->writeFieldBegin('queries', TType::LIST, 2);
     {
-      $xfer += $output->writeListBegin(TType::STRING, scalar(@{$self->{queries}}));
+      $xfer += $output->writeListBegin(TType::STRUCT, scalar(@{$self->{queries}}));
       {
         foreach my $iter161 (@{$self->{queries}}) 
         {
-          $xfer += $output->writeString($iter161);
+          $xfer += ${iter161}->write($output);
         }
       }
       $xfer += $output->writeListEnd();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-perl/Blur/Types.pm
----------------------------------------------------------------------
diff --git a/interface/gen-perl/Blur/Types.pm b/interface/gen-perl/Blur/Types.pm
index d93e3ab..a8416e8 100644
--- a/interface/gen-perl/Blur/Types.pm
+++ b/interface/gen-perl/Blur/Types.pm
@@ -32,6 +32,10 @@ use constant SHORT => 7;
 use constant BYTE => 8;
 use constant STRING_VAL => 9;
 use constant BYTES => 10;
+package Blur::QueryType;
+use constant STRING => 0;
+use constant JSON => 1;
+use constant BINARY => 2;
 package Blur::BlurException;
 use base qw(Thrift::TException);
 use base qw(Class::Accessor);
@@ -934,7 +938,7 @@ sub write {
 
 package Blur::TableDescriptor;
 use base qw(Class::Accessor);
-Blur::TableDescriptor->mk_accessors( qw( name enabled shardCount storagePath analyzer readOnly properties ) );
+Blur::TableDescriptor->mk_accessors( qw( name enabled shardCount storagePath analyzer readOnly defaultFieldName properties ) );
 
 sub new {
   my $classname = shift;
@@ -946,6 +950,7 @@ sub new {
   $self->{storagePath} = undef;
   $self->{analyzer} = undef;
   $self->{readOnly} = 0;
+  $self->{defaultFieldName} = "body";
   $self->{properties} = undef;
   if (UNIVERSAL::isa($vals,'HASH')) {
     if (defined $vals->{name}) {
@@ -966,6 +971,9 @@ sub new {
     if (defined $vals->{readOnly}) {
       $self->{readOnly} = $vals->{readOnly};
     }
+    if (defined $vals->{defaultFieldName}) {
+      $self->{defaultFieldName} = $vals->{defaultFieldName};
+    }
     if (defined $vals->{properties}) {
       $self->{properties} = $vals->{properties};
     }
@@ -1029,7 +1037,13 @@ sub read {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^7$/ && do{      if ($ftype == TType::MAP) {
+      /^7$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{defaultFieldName});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^8$/ && do{      if ($ftype == TType::MAP) {
         {
           my $_size48 = 0;
           $self->{properties} = {};
@@ -1092,8 +1106,13 @@ sub write {
     $xfer += $output->writeBool($self->{readOnly});
     $xfer += $output->writeFieldEnd();
   }
+  if (defined $self->{defaultFieldName}) {
+    $xfer += $output->writeFieldBegin('defaultFieldName', TType::STRING, 7);
+    $xfer += $output->writeString($self->{defaultFieldName});
+    $xfer += $output->writeFieldEnd();
+  }
   if (defined $self->{properties}) {
-    $xfer += $output->writeFieldBegin('properties', TType::MAP, 7);
+    $xfer += $output->writeFieldBegin('properties', TType::MAP, 8);
     {
       $xfer += $output->writeMapBegin(TType::STRING, TType::STRING, scalar(keys %{$self->{properties}}));
       {
@@ -1486,6 +1505,100 @@ sub write {
   return $xfer;
 }
 
+package Blur::Query;
+use base qw(Class::Accessor);
+Blur::Query->mk_accessors( qw( type queryString queryBinary ) );
+
+sub new {
+  my $classname = shift;
+  my $self      = {};
+  my $vals      = shift || {};
+  $self->{type} = undef;
+  $self->{queryString} = undef;
+  $self->{queryBinary} = undef;
+  if (UNIVERSAL::isa($vals,'HASH')) {
+    if (defined $vals->{type}) {
+      $self->{type} = $vals->{type};
+    }
+    if (defined $vals->{queryString}) {
+      $self->{queryString} = $vals->{queryString};
+    }
+    if (defined $vals->{queryBinary}) {
+      $self->{queryBinary} = $vals->{queryBinary};
+    }
+  }
+  return bless ($self, $classname);
+}
+
+sub getName {
+  return 'Query';
+}
+
+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->{type});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^2$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{queryString});
+      } else {
+        $xfer += $input->skip($ftype);
+      }
+      last; };
+      /^3$/ && do{      if ($ftype == TType::STRING) {
+        $xfer += $input->readString(\$self->{queryBinary});
+      } 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('Query');
+  if (defined $self->{type}) {
+    $xfer += $output->writeFieldBegin('type', TType::I32, 1);
+    $xfer += $output->writeI32($self->{type});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{queryString}) {
+    $xfer += $output->writeFieldBegin('queryString', TType::STRING, 2);
+    $xfer += $output->writeString($self->{queryString});
+    $xfer += $output->writeFieldEnd();
+  }
+  if (defined $self->{queryBinary}) {
+    $xfer += $output->writeFieldBegin('queryBinary', TType::STRING, 3);
+    $xfer += $output->writeString($self->{queryBinary});
+    $xfer += $output->writeFieldEnd();
+  }
+  $xfer += $output->writeFieldStop();
+  $xfer += $output->writeStructEnd();
+  return $xfer;
+}
+
 package Blur::QueryArgs;
 use base qw(Class::Accessor);
 Blur::QueryArgs->mk_accessors( qw( id after query filter numberToFetch aggregateResults sort doDocScores doMaxScore shardIndexes ) );
@@ -1571,8 +1684,9 @@ sub read {
         $xfer += $input->skip($ftype);
       }
       last; };
-      /^3$/ && do{      if ($ftype == TType::STRING) {
-        $xfer += $input->readString(\$self->{query});
+      /^3$/ && do{      if ($ftype == TType::STRUCT) {
+        $self->{query} = new Blur::Query();
+        $xfer += $self->{query}->read($input);
       } else {
         $xfer += $input->skip($ftype);
       }
@@ -1655,8 +1769,8 @@ sub write {
     $xfer += $output->writeFieldEnd();
   }
   if (defined $self->{query}) {
-    $xfer += $output->writeFieldBegin('query', TType::STRING, 3);
-    $xfer += $output->writeString($self->{query});
+    $xfer += $output->writeFieldBegin('query', TType::STRUCT, 3);
+    $xfer += $self->{query}->write($output);
     $xfer += $output->writeFieldEnd();
   }
   if (defined $self->{filter}) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-rb/blur.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur.rb b/interface/gen-rb/blur.rb
index 6bf4abf..f0a38e6 100644
--- a/interface/gen-rb/blur.rb
+++ b/interface/gen-rb/blur.rb
@@ -845,7 +845,7 @@ module Blur
 
       FIELDS = {
         OPTIONS => {:type => ::Thrift::Types::STRUCT, :name => 'options', :class => ::Blur::MutateOptions},
-        QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::STRING, :binary => true}}
+        QUERIES => {:type => ::Thrift::Types::LIST, :name => 'queries', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Blur::Query}}
       }
 
       def struct_fields; FIELDS; end

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/interface/gen-rb/blur_types.rb
----------------------------------------------------------------------
diff --git a/interface/gen-rb/blur_types.rb b/interface/gen-rb/blur_types.rb
index 00e92bf..af0d86e 100644
--- a/interface/gen-rb/blur_types.rb
+++ b/interface/gen-rb/blur_types.rb
@@ -63,6 +63,14 @@ module Blur
     VALID_VALUES = Set.new([SCORE, DOC, STRING, INT, FLOAT, LONG, DOUBLE, SHORT, BYTE, STRING_VAL, BYTES]).freeze
   end
 
+  module QueryType
+    STRING = 0
+    JSON = 1
+    BINARY = 2
+    VALUE_MAP = {0 => "STRING", 1 => "JSON", 2 => "BINARY"}
+    VALID_VALUES = Set.new([STRING, JSON, BINARY]).freeze
+  end
+
   # BlurException that carries a message plus the original stack
 # trace (if any).
   class BlurException < ::Thrift::Exception
@@ -284,7 +292,8 @@ module Blur
     STORAGEPATH = 4
     ANALYZER = 5
     READONLY = 6
-    PROPERTIES = 7
+    DEFAULTFIELDNAME = 7
+    PROPERTIES = 8
 
     FIELDS = {
       # The name of the table.
@@ -302,6 +311,8 @@ module Blur
       # This will only allow queries to be executed on the table.  The underlying implementation
 # does not open the index for writing, but will refresh the index periodically.
       READONLY => {:type => ::Thrift::Types::BOOL, :name => 'readOnly', :default => false},
+      # The default field name for any field where the field name is null.
+      DEFAULTFIELDNAME => {:type => ::Thrift::Types::STRING, :name => 'defaultFieldName', :default => %q"body"},
       # compressionClass,compressionBlockSize,similarityClass,blockCaching = 1,blockCachingFileTypes,columnPreCache
       PROPERTIES => {:type => ::Thrift::Types::MAP, :name => 'properties', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}}
     }
@@ -391,6 +402,35 @@ module Blur
     ::Thrift::Struct.generate_accessors self
   end
 
+  # The Query object describes how the query is passed.  If the
+# type is STRING or JSON the queryString field is used.  If
+# the BINARY type is used the queryBinary should be used.
+  class Query
+    include ::Thrift::Struct, ::Thrift::Struct_Union
+    TYPE = 1
+    QUERYSTRING = 2
+    QUERYBINARY = 3
+
+    FIELDS = {
+      # The query type.
+      TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Blur::QueryType},
+      # The query to be executed.
+      QUERYSTRING => {:type => ::Thrift::Types::STRING, :name => 'queryString'},
+      # The query to be executed.
+      QUERYBINARY => {:type => ::Thrift::Types::STRING, :name => 'queryBinary', :binary => true}
+    }
+
+    def struct_fields; FIELDS; end
+
+    def validate
+      unless @type.nil? || ::Blur::QueryType::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 QueryArgs
     include ::Thrift::Struct, ::Thrift::Struct_Union
     ID = 1
@@ -412,7 +452,7 @@ module Blur
 # ScoreDocs are fetched that occur after the given ScoreDoc.
       AFTER => {:type => ::Thrift::Types::STRUCT, :name => 'after', :class => ::Blur::ScoreDoc},
       # The query to be executed.
-      QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :binary => true},
+      QUERY => {:type => ::Thrift::Types::STRUCT, :name => 'query', :class => ::Blur::Query},
       # Filter to be executed.
       FILTER => {:type => ::Thrift::Types::STRING, :name => 'filter', :binary => true},
       # The number of document locations to fetch.

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java b/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
index 4f3015b..fa5dd2d 100644
--- a/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/analysis/BlurAnalyzer.java
@@ -58,6 +58,9 @@ public final class BlurAnalyzer extends AnalyzerWrapper {
       return;
     }
     List<AnalyzerType> analyzerTypes = analyzer.getAnalyzerTypes();
+    if (analyzerTypes == null) {
+      return;
+    }
     try {
       for (AnalyzerType analyzerType : analyzerTypes) {
         String indexName = analyzerType.getFieldName();

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java
new file mode 100644
index 0000000..a9ec238
--- /dev/null
+++ b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverter.java
@@ -0,0 +1,11 @@
+package org.apache.blur.lucene.search;
+
+import java.io.IOException;
+
+import org.apache.blur.thrift.generated.Query;
+
+public interface QueryConverter {
+
+  org.apache.lucene.search.Query convert(Query query) throws IOException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java
new file mode 100644
index 0000000..af5d883
--- /dev/null
+++ b/src/blur-core/src/main/java/org/apache/blur/lucene/search/QueryConverterImpl.java
@@ -0,0 +1,36 @@
+package org.apache.blur.lucene.search;
+
+import java.io.IOException;
+
+import org.apache.blur.analysis.BlurAnalyzer;
+import org.apache.blur.lucene.LuceneVersionConstant;
+import org.apache.blur.thrift.Configured;
+import org.apache.blur.thrift.TableContext;
+import org.apache.lucene.queryparser.classic.ParseException;
+import org.apache.lucene.queryparser.classic.QueryParser;
+import org.apache.lucene.search.Query;
+
+public class QueryConverterImpl extends Configured implements QueryConverter {
+
+  @Override
+  public Query convert(org.apache.blur.thrift.generated.Query query) throws IOException {
+    TableContext tableContext = getTableContext();
+    switch (query.getType()) {
+    case STRING:
+      BlurAnalyzer analyzer = tableContext.getAnalyzer();
+      QueryParser queryParser = new QueryParser(LuceneVersionConstant.LUCENE_VERSION, tableContext.getDefaultFieldName(), analyzer);
+      try {
+        return queryParser.parse(query.getQueryString());
+      } catch (ParseException e) {
+        throw new IOException(e);
+      }
+    case BINARY:
+      throw new IOException("Not supported.");
+    case JSON:
+      throw new IOException("Not supported.");
+    default:
+      throw new IOException("Not supported.");
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-core/src/main/java/org/apache/blur/manager/IndexServer.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/IndexServer.java b/src/blur-core/src/main/java/org/apache/blur/manager/IndexServer.java
index a0b2317..1268c08 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/IndexServer.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/IndexServer.java
@@ -23,6 +23,7 @@ import java.util.SortedSet;
 
 import org.apache.blur.analysis.BlurAnalyzer;
 import org.apache.blur.manager.writer.BlurIndex;
+import org.apache.blur.thrift.TableContext;
 
 
 public interface IndexServer {
@@ -145,4 +146,6 @@ public interface IndexServer {
    */
   void close();
 
+  TableContext getTableContext(String table) throws IOException;
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f92d94a9/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ClusterStatus.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ClusterStatus.java b/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ClusterStatus.java
index 004522a..40c9e8f 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ClusterStatus.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/clusterstatus/ClusterStatus.java
@@ -16,6 +16,7 @@ package org.apache.blur.manager.clusterstatus;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -45,7 +46,7 @@ public abstract class ClusterStatus {
 
   public abstract void createTable(TableDescriptor tableDescriptor);
 
-  public abstract void disableTable(String table);
+  public abstract void disableTable(String table) throws IOException;
 
   public abstract void enableTable(String table);
 


Mime
View raw message