About facet, for some dynamic fields(fields we don't know their names)


(Seven Q) #1

Here is the json:
{ "id": "100004",
"description": "some description",
"brand": "brand",
"displayName": "product",
"customProperties": {
"property1": "value1",
"property2": "value2" ....
}
}
child elements of "customProperties" could be added any time, and we can't
know the names.
So,I want to facet all of them one time.
Is there any solutions? I can't find anything about that, can Elasticsearch
support that right now?
Thanks!!!

--
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.


(Luca Cavanna) #2

You can facet on multiple fields at the same time, which results in merging
values coming from different fields into the same facet.
But you do need to know their names, and specify them when asking for the
facet.

"facets" : {
"property" : {
"terms" : {
"fields" : ["customProperties.property1", "customProperties.property2"],
"size" : 10
}
}
}

On Friday, October 11, 2013 11:03:41 AM UTC+2, Seven Q wrote:

Here is the json:
{ "id": "100004",
"description": "some description",
"brand": "brand",
"displayName": "product",
"customProperties": {
"property1": "value1",
"property2": "value2" ....
}
}
child elements of "customProperties" could be added any time, and we
can't know the names.
So,I want to facet all of them one time.
Is there any solutions? I can't find anything about that, can
Elasticsearch support that right now?
Thanks!!!

--
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.


(system) #3