We are using elasticsearch 0.20.1, were those code changes recent?
'_all:' and '' work, but not ':'
Clinton, could you point me at where in the source you found the code that
parses the query? Thanks again for the help.
curl -X GET 'http://localhost:9200/documents/_search?pretty&fields=all' -d
'{"query":{"query_string":{"query":"*"}}}'
{
"took" : 10,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "documents",
"_type" : "document",
"_id" : "blah",
"_score" : 1.0
}, {
"_index" : "documents",
"_type" : "document",
"_id" : "boom",
"_score" : 1.0
} ]
}
}
curl -X GET 'http://localhost:9200/documents/_search?pretty&fields=all' -d
'{"query":{"query_string":{"query":"_all:*"}}}'
{
"took" : 9,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2,
"max_score" : 1.0,
"hits" : [ {
"_index" : "documents",
"_type" : "document",
"_id" : "blah",
"_score" : 1.0
}, {
"_index" : "documents",
"_type" : "document",
"_id" : "boom",
"_score" : 1.0
} ]
}
}
curl -X GET 'http://localhost:9200/documents/_search?pretty&fields=all' -d
'{"query":{"query_string":{"query":":"}}}'
{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" :
}
}
On Wednesday, February 6, 2013 9:38:52 AM UTC-5, Clinton Gormley wrote:
On Wed, 2013-02-06 at 06:19 -0800, hanaf...@gmail.com <javascript:>wrote:
Thanks for pointing out my typo Clinton. However, we were indeed
using the ":" for the query:
curl -X GET 'http://localhost:9200/documents/_search?pretty' -d
'{"query":{"query_string":{"query":":"}}}'
what version of ES is this?
When I look at the code in master, it has this in the query string
wildcard parsing:
if (actualField == null) {
return newMatchAllDocsQuery();
}
if ("*".equals(actualField) || "_all".equals(actualField)) {
return newMatchAllDocsQuery();
}
which means that * _all:* and : should all work
Certainly that's the case when I test it out
clint
--
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.