Hi elasticers, how are u?
Can I request two facets (a string and a field of a nested field) in the
same request?
example of my facet request:
{
"query": {
"match": {
"product_name": {
"query": "red t-shirt",
"operator": "and",
"analyzer": "default",
"fuzziness": null,
"lenient": true,
"max_expansions": 100,
"minimum_should_match": 2,
"prefix_length": 2,
"type": null
}
}
},
"facets": {
"Mark": {
"terms": {
"fields": [
"mark_name"
],
"order": "count",
"all_terms": false,
"size": null,
"exclude": null,
"regex": null,
"regex_flags": null,
"script": null,
"script_field": "_source.mark_name",
"params": null,
"lang": null
},
"facet_filter": null
},
"Products": {
"terms": {
"fields": [
"product_name"
],
"order": "count",
"all_terms": false,
"size": null,
"exclude": null,
"regex": null,
"regex_flags": null,
"script": null,
"script_field": "_source.product_name",
"params": null,
"lang": null
},
"facet_filter": null
},
"Colors": {
"terms_stats": {
"fields": null,
"order": "total",
"all_TermsStats": null,
"size": null,
"exclude": null,
"regex": null,
"regex_flags": null,
"key_field": "color",
"value_field": "count",
"key_script": null,
"value_script": null,
"params": null,
"lang": null
},
"facet_filter": null
}
}
}
to me, it's return a Java Exception:
Caused by: org.elasticsearch.ElasticSearchIllegalArgumentException: failed
to find mappings for [count]
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.