Query returning wrong search result


(Mohit Anchlia) #1

When I run search, whatever I give in the query string I am getting back
that one doc which doesn't even match my results. Am I doing something
wrong?

My Json parser seem to be putting double quotes around fields. Does
elasticsearch expects double quotes in the query string? Something like
q="base64":true?

[root@dslg2 ~]# curl -XGET '
http://dslg1:9200/attributes/one/_search?q=base64:false1'
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"attributes","_type":"one","_id":"json.txt","_score":1.0,
"_source" : { "attributes" : [
{ "base64" : true,
"encrypted" : true,
"name" : "ssn",
"value" : "EAAgfyaxpzdfcfv9Qexq1WtGvA=="
},
{ "base64" : false,
"encrypted" : false,
"name" : "deviceId",
"value" : "aass11234aaaxxxCC"
}
],
"version" : 1337298622093
}
}]}}[root@dslg2 ~]# curl -XGET '
http://dslg1:9200/attributes/one/_search?q=base64'
{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"attributes","_type":"one","_id":"json.txt","_score":1.0,
"_source" : { "attributes" : [
{ "base64" : true,
"encrypted" : true,
"name" : "ssn",
"value" : "EAAgfyaxpzdfcfv9Qexq1WtGvA=="
},
{ "base64" : false,
"encrypted" : false,
"name" : "deviceId",
"value" : "aass11234aaaxxxCC"
}
],
"version" : 1337298622093
}


(Shay Banon) #2

base64 is a boolean field, any value other than false, 0, off, no is
considered true.

On Fri, May 18, 2012 at 10:24 PM, Mohit Anchlia mohitanchlia@gmail.comwrote:

When I run search, whatever I give in the query string I am getting back
that one doc which doesn't even match my results. Am I doing something
wrong?

My Json parser seem to be putting double quotes around fields. Does
elasticsearch expects double quotes in the query string? Something like
q="base64":true?

[root@dslg2 ~]# curl -XGET '
http://dslg1:9200/attributes/one/_search?q=base64:false1'
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"attributes","_type":"one","_id":"json.txt","_score":1.0,
"_source" : { "attributes" : [
{ "base64" : true,
"encrypted" : true,
"name" : "ssn",
"value" : "EAAgfyaxpzdfcfv9Qexq1WtGvA=="
},
{ "base64" : false,
"encrypted" : false,
"name" : "deviceId",
"value" : "aass11234aaaxxxCC"
}
],
"version" : 1337298622093
}
}]}}[root@dslg2 ~]# curl -XGET '
http://dslg1:9200/attributes/one/_search?q=base64'
{"took":4,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":1.0,"hits":[{"_index":"attributes","_type":"one","_id":"json.txt","_score":1.0,
"_source" : { "attributes" : [
{ "base64" : true,
"encrypted" : true,
"name" : "ssn",
"value" : "EAAgfyaxpzdfcfv9Qexq1WtGvA=="
},
{ "base64" : false,
"encrypted" : false,
"name" : "deviceId",
"value" : "aass11234aaaxxxCC"
}
],
"version" : 1337298622093
}


(system) #3