Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved all_fields sorting to JS. Removed duplicate ES query for statis…

…tics, should be faster now
  • Loading branch information...
commit 705f9e7791fbb4cc2f444314668fba766922ab10 1 parent 0fa94db
Rashid Khan authored
Showing with 5 additions and 20 deletions.
  1. +3 −1 js/ajax.js
  2. +2 −19 loader2.php
View
4 js/ajax.js
@@ -135,6 +135,7 @@ function getPage() {
var analyzestr =
'<ul id=analyze_list class="nav nav-pills nav-stacked">';
var afield = '';
+ window.resultjson.all_fields.sort();
for (var index in resultjson.all_fields) {
afield = resultjson.all_fields[index].toString().replace(
'@', 'ATSYM') + "_field";
@@ -697,7 +698,8 @@ function mFields(field) {
str += "<a class='jlink mfield logfield_selected'>"
+ window.hashjson.fields[index] + "</a> ";
}
- for (var index in resultjson.all_fields) {
+
+ for (var index in window.resultjson.all_fields) {
if ($.inArray(resultjson.all_fields[index].toString(),
window.hashjson.fields) < 0) {
str += "<a class='jlink mfield " +
View
21 loader2.php
@@ -262,7 +262,7 @@ protected function processQuery ($req, $query) {
break;
case 'mean':
- $return = $this->statField($req, $query, $return);
+ $return->analysis->results = $result->facets->statistics;
break;
default:
@@ -296,7 +296,7 @@ protected function processQuery ($req, $query) {
}
unset($result->hits->hits[$i]);
}
- sort($return->all_fields);
+ //sort($return->all_fields);
}
if (sizeof($req->fields) == 0) $req->fields = array('@message');
$return->fields_requested = $req->fields;
@@ -471,23 +471,6 @@ protected function analyzeField ($req, $query, $return) {
} //end analyzeField
/**
- * Run statistical facet against field
- *
- * @param object $req Request data
- * @param object $query ES query
- * @param object $return Partial response
- * @return object Response to request
- */
- protected function statField ($req, $query, $return) {
- $field = self::canonicalFieldName($req->analyze_field);
- $result = $this->esQuery($query);
- $return->analysis->results = $result->facets->statistics;
-
- return $return;
-
- } //end statField
-
- /**
* Compute trends in the values of a field.
*
* @param object $req Request data
Please sign in to comment.
Something went wrong with that request. Please try again.