I created some random data to test search.
When it do I match query, it works fine.
curl -XGET
'http://ec2-54-224-40-21.compute-1.amazonaws.com:9200/test/test/_search?pretty=true'
-d '{query:{"match": {"field1":"PITU"}}}'
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 10.21034,
"hits" : [ {
"_index" : "test",
"_type" : "test",
"_id" : "78116",
"_score" : 10.21034, "_source" : {"id":78115,"field1":"PITU","field2":"DKBV
GOAT","field3":"JXIX FPOZ WZIV","field4":"GQWZ AFHU VMJF
AENE","field5":"BFEJ BEEX CHNM VCEL
NALA","date":"2013-03-20T02:50:57.927Z","site":"A"}
} ]
}
but when I try the same thing with a term query, I don't get any results.
curl -XGET
'http://ec2-54-224-40-21.compute-1.amazonaws.com:9200/test/test/_search?pretty=true'
-d '{query:{"term": {"field1":"PITU"}}}'
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
The strangest part is that when I change to search value to all lowercase,
I get a valid result back
curl -XGET
'http://ec2-54-224-40-21.compute-1.amazonaws.com:9200/test/test/_search?pretty=true'
-d '{query:{"term": {"field1":"pitu"}}}'
{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 10.21034,
"hits" : [ {
"_index" : "test",
"_type" : "test",
"_id" : "78116",
"_score" : 10.21034, "_source" : {"id":78115,"field1":"PITU","field2":"DKBV
GOAT","field3":"JXIX FPOZ WZIV","field4":"GQWZ AFHU VMJF
AENE","field5":"BFEJ BEEX CHNM VCEL
NALA","date":"2013-03-20T02:50:57.927Z","site":"A"}
} ]
}
Is this the expected behavior?
Also, I am still not sure what the difference between term/match/field
query is. Any help (or links to related questions) would be appreciated.
Thanks!
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.