|
@@ -2171,12 +2171,14 @@ ${ dashboard.layout_skeleton(suffix='search') }
|
|
|
<input type="number" class="input-mini" data-bind="value: percentile"/>
|
|
<input type="number" class="input-mini" data-bind="value: percentile"/>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
|
|
|
|
|
- <select data-bind="options: $root.collection.template.facetFieldsNames, value: $parent.field, optionsCaption: '${ _ko('Field...') }', selectize: $root.collection.template.facetFieldsNames" class="hit-options input-small" style="margin-bottom: 0"></select>
|
|
|
|
|
|
|
+ ##<select data-bind="options: facetFieldsNames, value: $parent.field, optionsCaption: '${ _ko('Field...') }', selectize: facetFieldsNames" class="hit-options input-small" style="margin-bottom: 0"></select>
|
|
|
|
|
+ <select data-bind="selectize: facetFieldsNames, value: $parent.field, optionsValue: 'name', optionsText: 'name', optionsCaption: '${ _ko('Field...') }'"></select>
|
|
|
|
|
+ ##<select data-bind="browserAwareSelectize: facetFieldsNames, value: $parent.field"></select>
|
|
|
|
|
|
|
|
<div class="clearfix"></div>
|
|
<div class="clearfix"></div>
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
|
|
- <div data-bind="component: { name: 'hue-simple-ace-editor', params: { value: plain_formula, parsedValue: formula, autocomplete: { type: 'solrFormula', support: { fields: $root.collection.template.fieldsAttributes } }, singleLine: true, mode: $root.collection.engine() } }, visible: $parent.field() == 'formula'" class="margin-bottom-10"></div>
|
|
|
|
|
|
|
+ <div data-bind="component: { name: 'hue-simple-ace-editor', params: { value: plain_formula, parsedValue: formula, autocomplete: { type: 'solrFormula', support: { fields: $root.collection.template.fieldsAttributes } }, singleLine: true, mode: $root.collection.engine() } }, visible: $data.function() == 'formula'" class="margin-bottom-10"></div>
|
|
|
|
|
|
|
|
<!-- ko if: $parents[1].widgetType() != 'hit-widget' -->
|
|
<!-- ko if: $parents[1].widgetType() != 'hit-widget' -->
|
|
|
<div class="facet-field-cnt">
|
|
<div class="facet-field-cnt">
|
|
@@ -2259,7 +2261,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
|
|
|
</a>
|
|
</a>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
<!-- ko if: typeof $parents[0].isAdding !== 'undefined' && $parents[0].isAdding() -->
|
|
<!-- ko if: typeof $parents[0].isAdding !== 'undefined' && $parents[0].isAdding() -->
|
|
|
- <a data-bind="visible: (typeof field !== 'undefined' && field() != 'formula') || aggregate.formula(), click: function() { $root.collection.addPivotFacetValue2($parents[0]) }" class="pull-right" href="javascript:void(0)">
|
|
|
|
|
|
|
+ <a data-bind="visible: aggregate.function() != 'formula' || aggregate.formula(), click: function() { $root.collection.addPivotFacetValue2($parents[0]) }" class="pull-right" href="javascript:void(0)">
|
|
|
<i class="fa fa-plus"></i> ${ _('Add') }
|
|
<i class="fa fa-plus"></i> ${ _('Add') }
|
|
|
</a>
|
|
</a>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
@@ -3019,7 +3021,8 @@ var NUMERIC_HIT_OPTIONS = [
|
|
|
{ value: "median", label: "${ _('Median') }" },
|
|
{ value: "median", label: "${ _('Median') }" },
|
|
|
{ value: "percentile", label: "${ _('Percentile') }" },
|
|
{ value: "percentile", label: "${ _('Percentile') }" },
|
|
|
{ value: "stddev", label: "${ _('Stddev') }" },
|
|
{ value: "stddev", label: "${ _('Stddev') }" },
|
|
|
- { value: "variance", label: "${ _('Variance') }" }
|
|
|
|
|
|
|
+ { value: "variance", label: "${ _('Variance') }" },
|
|
|
|
|
+ { value: "formula", label: "${ _('Formula') }" },
|
|
|
];
|
|
];
|
|
|
var DATETIME_HIT_OPTIONS = [
|
|
var DATETIME_HIT_OPTIONS = [
|
|
|
{ value: "count", label: "${ _('Group by') }" },
|
|
{ value: "count", label: "${ _('Group by') }" },
|
|
@@ -3028,21 +3031,24 @@ var DATETIME_HIT_OPTIONS = [
|
|
|
{ value: "min", label: "${ _('Min') }" },
|
|
{ value: "min", label: "${ _('Min') }" },
|
|
|
{ value: "max", label: "${ _('Max') }" },
|
|
{ value: "max", label: "${ _('Max') }" },
|
|
|
{ value: "median", label: "${ _('Median') }" },
|
|
{ value: "median", label: "${ _('Median') }" },
|
|
|
- { value: "percentile", label: "${ _('Percentile') }" }
|
|
|
|
|
|
|
+ { value: "percentile", label: "${ _('Percentile') }" },
|
|
|
|
|
+ { value: "formula", label: "${ _('Formula') }" },
|
|
|
];
|
|
];
|
|
|
var ALPHA_HIT_COUNTER_OPTIONS = [
|
|
var ALPHA_HIT_COUNTER_OPTIONS = [
|
|
|
##{ value: "count", label: "${ _('Group by') }" },
|
|
##{ value: "count", label: "${ _('Group by') }" },
|
|
|
##{ value: "counts", label: "Count" },
|
|
##{ value: "counts", label: "Count" },
|
|
|
{ value: "unique", label: "${ _('Unique') }" },
|
|
{ value: "unique", label: "${ _('Unique') }" },
|
|
|
{ value: "min", label: "${ _('Min') }" },
|
|
{ value: "min", label: "${ _('Min') }" },
|
|
|
- { value: "max", label: "${ _('Max') }" }
|
|
|
|
|
|
|
+ { value: "max", label: "${ _('Max') }" },
|
|
|
|
|
+ { value: "formula", label: "${ _('Formula') }" },
|
|
|
];
|
|
];
|
|
|
var ALPHA_HIT_OPTIONS = [
|
|
var ALPHA_HIT_OPTIONS = [
|
|
|
{ value: "count", label: "${ _('Group by') }" },
|
|
{ value: "count", label: "${ _('Group by') }" },
|
|
|
## { value: "counts", label: "Count" },
|
|
## { value: "counts", label: "Count" },
|
|
|
{ value: "unique", label: "${ _('Unique') }" },
|
|
{ value: "unique", label: "${ _('Unique') }" },
|
|
|
{ value: "min", label: "${ _('Min') }" },
|
|
{ value: "min", label: "${ _('Min') }" },
|
|
|
- { value: "max", label: "${ _('Max') }" }
|
|
|
|
|
|
|
+ { value: "max", label: "${ _('Max') }" },
|
|
|
|
|
+ { value: "formula", label: "${ _('Formula') }" },
|
|
|
];
|
|
];
|
|
|
var HIT_OPTIONS = NUMERIC_HIT_OPTIONS
|
|
var HIT_OPTIONS = NUMERIC_HIT_OPTIONS
|
|
|
;
|
|
;
|
|
@@ -3063,7 +3069,7 @@ function getHitOption(value) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function getPrettyMetric(facet) {
|
|
function getPrettyMetric(facet) {
|
|
|
- if (facet.field() == 'formula') {
|
|
|
|
|
|
|
+ if (facet.aggregate.function() == 'formula') {
|
|
|
return facet.aggregate.plain_formula()
|
|
return facet.aggregate.plain_formula()
|
|
|
} else if (facet.aggregate.function() == 'percentile') {
|
|
} else if (facet.aggregate.function() == 'percentile') {
|
|
|
return 'percentile(' + facet.aggregate.percentiles()[0]['value']() + ')';
|
|
return 'percentile(' + facet.aggregate.percentiles()[0]['value']() + ')';
|