Unnecessary override of the title property in the buckets creation
vanch3d opened this issue · comments
The configuration for an aggregation defines a title
property, such as:
{
aggregations: {
tags: {
title: 'Tags',
// conjunctive facet (AND)
conjunction: true,
// the default is 10
size: 20
},
rating: {
title: 'Actors',
// non conjunctive facet (OR)
conjunction: false,
// it is sorting by value (not by count). 'count' is the default
sort: 'term',
order: 'asc',
size: 5
}
}
}
I assumed it could be used for the UI part of the facets, once the search has been succesful.
But the code for creating the buckets automatically generates a title
property out of a humanised version of the id, see
Lines 236 to 241 in 06e2e70
- Is
title
used anywhere else in the code or by other integrations? - Would it make sense to use the humanised version only is the
title
has not been defined in the configuration, e.g.
return {
name: k,
title: aggregations[k].title || humanize(k),
position: position++,
buckets: buckets
};