Changeset 1578
- Timestamp:
- Oct 3, 2010, 5:44:01 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/modules/solr/actions/actions.class.php
r1552 r1578 68 68 } 69 69 //Récupère les résultats auprès de SolR 70 $params = array('hl'=>'true', 'fl' => 'id,object_id,object_name,date', 'hl.fragsize'=>500, "facet"=>"true", "facet.field"=>array("object_name","tag"), "facet.date" => "date", "facet.date.start"=>"2007-05-01T00:00:00Z", "facet.date.end"=>"NOW", "facet.date.gap"=>"+1MONTH", 'fq' => $fq );70 $params = array('hl'=>'true', 'fl' => 'id,object_id,object_name,date', 'hl.fragsize'=>500, "facet"=>"true", "facet.field"=>array("object_name","tag"), "facet.date" => "date", "facet.date.start"=>"2007-05-01T00:00:00Z", "facet.date.end"=>"NOW", "facet.date.gap"=>"+1MONTH", 'fq' => $fq, "facet.date.include" => "edge"); 71 71 $this->sort_type = 'pertinence'; 72 72 … … 121 121 $this->vue = 'par_mois'; 122 122 123 $period = ''; 124 123 125 if ($date) { 124 126 $this->selected['date'][$date] = $date; … … 155 157 } 156 158 159 if ($period == 'DAY') { 160 $from = date ('Y-m-d', strtotime($from)-(3600*2+1)).'T23:59:59Z'; 161 } 162 157 163 $query .= ' date:['.$from.' TO '.$to.']'; 158 164 $params['facet.date.start'] = $from; … … 162 168 163 169 $this->start = $params['facet.date.start']; 170 if ($period == 'DAY') { 171 $this->start = date ('Y-m-d', strtotime($this->start)+1).'T00:00:00Z'; 172 } 164 173 $this->end = $params['facet.date.end']; 165 174 … … 233 242 $this->fdates['max'] = 1; 234 243 foreach($results['facet_counts']['facet_dates']['date'] as $date => $nb) { 244 if ($period == 'DAY') { 245 $date = date ('Y-m-d', strtotime($date)+1).'T00:00:00Z'; 246 } 235 247 if (preg_match('/^20/', $date)) { 236 248 $pc = $nb/$results['response']['numFound'];
Note: See TracChangeset
for help on using the changeset viewer.