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...
I'm new to elastic, considering to move from a proprietary system...
I'm blocked on the fact that I can't get list of field hits per document as
part of search results... Any help any clue?
I'm new to elastic, considering to move from a proprietary system...
I'm blocked on the fact that I can't get list of field hits per document
as part of search results... Any help any clue?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.