@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function app_content($request, $args){ |
|
3 | +function app_content($request, $args) { |
|
4 | 4 | |
5 | 5 | global $ES; |
6 | 6 | $index = $args['index']; |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | } |
26 | 26 | } |
27 | 27 | $results = $ES->search($params); |
28 | - foreach($results['hits']['hits'] as $doc){ |
|
28 | + foreach ($results['hits']['hits'] as $doc) { |
|
29 | 29 | $doc['_source']['_id'] = $doc['_id']; |
30 | - $documents[]=$doc['_source']; |
|
30 | + $documents[] = $doc['_source']; |
|
31 | 31 | } |
32 | 32 | $params['search_type'] = 'count'; |
33 | 33 | $count = $ES->search($params); |
34 | 34 | $nof = 0; |
35 | - if(isset($count['hits']['total'])){ |
|
36 | - $nof = (int) $count['hits']['total']; |
|
35 | + if (isset($count['hits']['total'])) { |
|
36 | + $nof = (int) $count['hits']['total']; |
|
37 | 37 | } |
38 | - return ['app_title'=>$index."/".$type ,'data'=>[ 'index' => $index, 'type' => $type, 'documents'=> $documents, 'from' => $from, 'nof'=>$nof, 'size' => $size,'sort'=>$sort, 'query'=>$query]]; |
|
38 | + return ['app_title'=>$index . "/" . $type, 'data'=>['index' => $index, 'type' => $type, 'documents'=> $documents, 'from' => $from, 'nof'=>$nof, 'size' => $size, 'sort'=>$sort, 'query'=>$query]]; |
|
39 | 39 | } |