Hello,
I have an index seach-2019-08* and it has term site. I want to count the terms based on the starting character of the site.
GET search-2019-08*/_count
{ "query": { "bool": {
"must": [
{
"term": {
"site": "a*"
} } ] } }}
I'm looking for the count of documents with site starts with a. but, it always return 0. But, I know, there is some data like that
abdon
(Abdon Pijpelink)
December 14, 2019, 12:32pm
2
You can't use wildcards in a term
query. What you're doing here is search for documents that contain the exact two characters a
and *
.
If you want to use wildcards, you have to use the wildcard
query:
GET search-2019-08*/_count
{
"query": {
"wildcard": {
"site": {
"value": "a*"
}
}
}
}
system
(system)
Closed
January 11, 2020, 12:32pm
3
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.