mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
PHRAS-1873 PORT PHRAS-1685 dump esquery
This commit is contained in:
@@ -178,6 +178,8 @@ class QueryController extends Controller
|
|||||||
|
|
||||||
$page = $result->getCurrentPage($perPage);
|
$page = $result->getCurrentPage($perPage);
|
||||||
|
|
||||||
|
$queryESLib = $result->getQueryESLib();
|
||||||
|
|
||||||
$string = '';
|
$string = '';
|
||||||
|
|
||||||
if ($npages > 1) {
|
if ($npages > 1) {
|
||||||
@@ -230,19 +232,15 @@ class QueryController extends Controller
|
|||||||
}
|
}
|
||||||
$string .= '<div style="display:none;"><div id="NEXT_PAGE"></div><div id="PREV_PAGE"></div></div>';
|
$string .= '<div style="display:none;"><div id="NEXT_PAGE"></div><div id="PREV_PAGE"></div></div>';
|
||||||
|
|
||||||
$explain = "<div id=\"explainResults\" class=\"myexplain\">";
|
$explain = $this->render(
|
||||||
|
"prod/results/infos.html.twig",
|
||||||
$explain .= "<img src=\"/assets/common/images/icons/answers.gif\" /><span><b>";
|
[
|
||||||
|
'results'=> $result,
|
||||||
if ($result->getTotal() != $result->getAvailable()) {
|
'esquery' => $this->getAclForUser()->is_admin() ?
|
||||||
$explain .= $this->app->trans('reponses:: %available% Resultats rappatries sur un total de %total% trouves', ['available' => $result->getAvailable(), '%total%' => $result->getTotal()]);
|
json_encode($queryESLib['body'], JSON_PRETTY_PRINT | JSON_HEX_TAG | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES) :
|
||||||
} else {
|
null
|
||||||
$explain .= $this->app->trans('reponses:: %total% Resultats', ['%total%' => $result->getTotal()]);
|
]
|
||||||
}
|
);
|
||||||
|
|
||||||
$explain .= " </b></span>";
|
|
||||||
$explain .= '<br><div>' . ($result->getDuration() / 1000) . ' s</div>dans index ' . $result->getIndexes();
|
|
||||||
$explain .= "</div>";
|
|
||||||
|
|
||||||
$infoResult = '<div id="docInfo">'
|
$infoResult = '<div id="docInfo">'
|
||||||
. $this->app->trans('%number% documents<br/>selectionnes', ['%number%' => '<span id="nbrecsel"></span>'])
|
. $this->app->trans('%number% documents<br/>selectionnes', ['%number%' => '<span id="nbrecsel"></span>'])
|
||||||
@@ -354,7 +352,7 @@ class QueryController extends Controller
|
|||||||
$json['form'] = $options->serialize();
|
$json['form'] = $options->serialize();
|
||||||
$json['queryCompiled'] = $result->getQueryCompiled();
|
$json['queryCompiled'] = $result->getQueryCompiled();
|
||||||
$json['queryAST'] = $result->getQueryAST();
|
$json['queryAST'] = $result->getQueryAST();
|
||||||
$json['queryESLib'] = $result->getQueryESLib();
|
$json['queryESLib'] = $queryESLib;
|
||||||
}
|
}
|
||||||
catch(\Exception $e) {
|
catch(\Exception $e) {
|
||||||
// we'd like a message from the parser so get all the exceptions messages
|
// we'd like a message from the parser so get all the exceptions messages
|
||||||
|
19
templates/web/prod/results/infos.html.twig
Normal file
19
templates/web/prod/results/infos.html.twig
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<div id="explainResults" class="myexplain">
|
||||||
|
<img src="/assets/common/images/icons/answers.gif" />
|
||||||
|
<span>
|
||||||
|
<b>
|
||||||
|
{% set total = results.getTotal() %}
|
||||||
|
{% trans %}reponses:: %total% Resultats{% endtrans %}
|
||||||
|
</b>
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
<div>
|
||||||
|
{{ results.getDuration() / 1000 }} s
|
||||||
|
</div>
|
||||||
|
dans index {{ results.getIndexes() }}
|
||||||
|
{% if not(esquery is null) %}
|
||||||
|
<div>
|
||||||
|
<pre>{{ esquery }}</pre>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
Reference in New Issue
Block a user