Repository: basho/riak-nodejs-client (js)
Issue: secondary index query on "*_bin"  index with long string value with only digits returns nothing [JIRA: CLIENTS-502]
```
var Riak = require('basho-riak-client');
var client = new Riak.Client();
    var obj = new Riak.Commands.KV.RiakObject();
    obj.setValue({test:1});
var indexVal  ="9999999999999999";
    obj.setIndex("test_bin", [indexVal  ])
    client.storeValue({bucket:"test-bin-index", key: "test-bin-index", value: obj }, function(err, res){
        if ( err )
            return console.error(err.stack);

       client.secondaryIndexQuery({bucket: "test-bin-index", indexName: "test_bin", indexKey: indexVal  , stream: false }, function(err, res){
            if ( err )
                return console.error(err);
            console.log(res);
            process.exit(0)
        })
    });
```

result: `{ values: [], done: true, continuation: null }`

http interface works fine  via 
`buckets/test-bin-index/index/test_bin/9999999999999999`


adding string prefix or suffix to index value FIX an issue
reduce number inside string by 1 fix an issue, so its works fine for `9999999999999998`














Pull request description: CLIENTS-502
Small improvements to PR#82

Fixes #80 

Thanks a lot @mogadanez

Patch:
diff --git a/lib/commands/kv/secondaryindexquery.js b/lib/commands/kv/secondaryindexquery.js
index e2e5fa8..e91b845 100644
--- a/lib/commands/kv/secondaryindexquery.js
+++ b/lib/commands/kv/secondaryindexquery.js
@@ -181,18 +181,24 @@ SecondaryIndexQuery.prototype.onSuccess = function(rpbIndexResp) {
 
 // Explicitly set null on options for protobufs and for conditionals
 var schema = Joi.object().keys({
-   bucket: Joi.string().required(),
-   bucketType: Joi.string().default('default'),
-   indexName: Joi.string().required(),
-   indexKey: Joi.alternatives().try(Joi.number(), Joi.string()).default(null).optional(),
-   rangeStart: Joi.alternatives().try(Joi.number(), Joi.string()).default(null).optional(),
-   rangeEnd: Joi.alternatives().try(Joi.number(), Joi.string()).default(null).optional(),
-   returnKeyAndIndex: Joi.boolean().default(null).optional(),
-   maxResults: Joi.number().default(null).optional(),
-   continuation: Joi.any().default(null).optional(),
-   timeout: Joi.number().default(null).optional(),
-   stream: Joi.boolean().default(true).optional(),
-   paginationSort: Joi.boolean().default(null).optional()
+    bucket: Joi.string().required(),
+    bucketType: Joi.string().default('default'),
+    indexName: Joi.string().required(),
+    indexKey: Joi.alternatives().try(
+            Joi.number().options({ convert: false }), Joi.string()
+        ).default(null).optional(),
+    rangeStart: Joi.alternatives().try(
+            Joi.number().options({ convert: false }), Joi.string()
+        ).default(null).optional(),
+    rangeEnd: Joi.alternatives().try(
+            Joi.number().options({ convert: false }), Joi.string()
+        ).default(null).optional(),
+    returnKeyAndIndex: Joi.boolean().default(null).optional(),
+    maxResults: Joi.number().default(null).optional(),
+    continuation: Joi.any().default(null).optional(),
+    timeout: Joi.number().default(null).optional(),
+    stream: Joi.boolean().default(true).optional(),
+    paginationSort: Joi.boolean().default(null).optional()
 });
 
 


Test patch:
diff --git a/test/unit/kv/secondaryindexquery.js b/test/unit/kv/secondaryindexquery.js
index c8ac42c..e512889 100644
--- a/test/unit/kv/secondaryindexquery.js
+++ b/test/unit/kv/secondaryindexquery.js
@@ -56,7 +56,32 @@ describe('SecondaryIndexQuery', function() {
             
             
         });
-        
+
+        it('should build a RpbIndexReq correctly for a single _bin key query without string2int conversion', function(done) {
+            var siq = new SecondaryIndexQuery.Builder()
+                .withBucket('MyBucket')
+                .withIndexName('test_bin')
+                .withIndexKey('9999999999999999')
+                .withCallback(function(){})
+                .build();
+            var protobuf = siq.constructPbRequest();
+            assert.equal(protobuf.getKey().toString('utf8'), '9999999999999999');
+            done();
+        });
+
+        it('should build a RpbIndexReq correctly for a range query without string2int conversion', function(done) {
+            var siq = new SecondaryIndexQuery.Builder()
+                .withBucket('MyBucket')
+                .withIndexName('test_bin')
+                .withRange('9999999999999999', '9999999999999999')
+                .withCallback(function(){})
+                .build();
+            var protobuf = siq.constructPbRequest();
+            assert.equal(protobuf.getRangeMin().toString('utf8'), '9999999999999999');
+            assert.equal(protobuf.getRangeMax().toString('utf8'), '9999999999999999');
+            done();
+        });
+
         it('should build a RpbIndexReq correctly for a range query', function(done) {
             
             var siq = new SecondaryIndexQuery.Builder()