Answer the question
In order to leave comments, you need to log in
How to get a counted list of documents by field value?
I use Amazon's OpenSearch, which I understand is ES.
The index contains documents that have a custom "type" subfield. How can I get a list of the values of this field contained in the index, and the number of docks for each type?
Essence of expected response:
Type: Node - 12,
Type: Folder - 10, etc.
Index:
{ _index: res-1,
_id: 1234,
...
_source: {
resource: {
....
type: Node,
}
}
}
Answer the question
In order to leave comments, you need to log in
If this is elasticsearch, then you need to look at the aggressions on nested fields. But the request type depends on the version. Start here - https://www.elastic.co/guide/en/elasticsearch/ref...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question