diff --git a/webui/system/database/sphinx.php b/webui/system/database/sphinx.php index 45ed75f..f57eeef 100644 --- a/webui/system/database/sphinx.php +++ b/webui/system/database/sphinx.php @@ -72,6 +72,17 @@ if(ENABLE_SYSLOG == 1) { syslog(LOG_INFO, sprintf("sphinx query: '%s' in %.2f s, %d hits, %d total found", $query->query, $query->exec_time, $query->num_rows, $query->total_found)); } + $session = Registry::get('session'); + $sphx_query = ''; + + $b = preg_split("/\ ORDER\ /", $query->query); + $a = preg_split("/\ WHERE\ /", $b[0]); + if(isset($a[1])) { + $sphx_query = preg_replace("/\'/", "\'", $a[1]); + } + + $session->set("sphx_query", $sphx_query); + return $query; } diff --git a/webui/view/theme/default/templates/search/helper.tpl b/webui/view/theme/default/templates/search/helper.tpl index 5409b6a..8692670 100644 --- a/webui/view/theme/default/templates/search/helper.tpl +++ b/webui/view/theme/default/templates/search/helper.tpl @@ -136,6 +136,10 @@ + get("sphx_query")) { ?> + ', 5);">sphinx + + diff --git a/webui/view/theme/mobile/templates/search/helper.tpl b/webui/view/theme/mobile/templates/search/helper.tpl index ab82d78..9a41ef7 100644 --- a/webui/view/theme/mobile/templates/search/helper.tpl +++ b/webui/view/theme/mobile/templates/search/helper.tpl @@ -101,6 +101,10 @@ > >   >>   >> + get("sphx_query")) { ?> + ', 5);">sphinx + +