Hi, I'm trying to create a query that will return count of hits per doc
type and field name.
For example if I have the following docs:
type X
[
{f1: ..., f2: "a b c"},
{f1: ..., f2: "b c d"},
{f1: ..., f2: "c d e"},
]
type Y
[
{f3: ..., f4: "d e f"},
{f3: ..., f4: "e f g"},
{f3: ..., f4: "f g h"},
]
I want to query for types and field names containing hits for "d":
[
{Type: X, Field: f2, Count: 2}
{Type: Y, Field: f4, Count: 1}
]
I don't want to run a query that will pull all docs matching "d" and then
aggregate metadata on the client as the number of docs can be really big...
I've searched this group and found couple posts suggesting to read mappings
to figure out types and field names, but I don't want to run separate query
per typeXfieldname as metadata in my case can be really big (number of
typeXfieldName can be in hundreds).
Well, I can actually push doc type into each document as a field, but I'm
still left with aggregation by field name hits...
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/583d45e9-ea2b-4567-9f97-93f4c545b99d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.