Changeset 1447
- Timestamp:
- Sep 27, 2010, 12:17:10 AM (10 years ago)
- Location:
- cpc/trunk/project/apps/frontend/modules/solr
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/apps/frontend/modules/solr/actions/actions.class.php
r1446 r1447 75 75 $type = $request->getParameter('type'); 76 76 77 $this->tags = 0; 77 78 if ($type) { 78 79 sfConfig::set('sf_web_debug', false); 80 $this->tags = $request->getParameter('tags'); 79 81 } 80 82 … … 101 103 102 104 if ($type == 'csv') { 103 $this->getResponse()->setContentType('application/csv; charset=utf-8'); 105 // $this->getResponse()->setContentType('application/csv; charset=utf-8'); 106 $this->getResponse()->setContentType('text/plain; charset=utf-8'); 104 107 $this->setTemplate('csv'); 105 108 $this->setLayout(false); -
cpc/trunk/project/apps/frontend/modules/solr/templates/csvSuccess.php
r1446 r1447 1 <?php if (!$tags) :?> 1 2 type document;document id;url vers document;resultats <?php echo $results['start'] + 1; ?> à <?php echo $results['end'] - 1; ?> sur <?php echo $results['numFound']; ?> 2 3 … … 10 11 echo ";\n"; 11 12 } 12 13 return; 14 endif; 15 ?> 16 tag type;tag nom;nb 17 <?php 18 foreach(array_keys($facet) as $k) 19 if (isset($facet[$k]['values']) && count($facet[$k]['values'])) 20 foreach($facet[$k]['values'] as $value => $nb) 21 if ($nb) 22 echo "$k:$value:$nb\n"; -
cpc/trunk/project/apps/frontend/modules/solr/templates/jsonSuccess.php
r1446 r1447 1 { 2 "start": <?php echo $results['start'] + 1; ?>, 3 "end" : <?php echo $results['end'] - 1; ?>, 4 "last_result" : <?php echo $results['numFound']; ?>, 5 "results" : { 6 <?php 1 <?php if (!$tags) : ?> 2 { "start": <?php echo $results['start'] + 1; ?>, "end" : <?php echo $results['end'] - 1; ?>, "last_result" : <?php echo $results['numFound']; ?>, "results" : {<?php 7 3 $nb = 0; 8 4 foreach ($results['docs'] as $record) … … 16 12 echo "document_url:\"\"]"; 17 13 } 18 ?> }} 19 14 ?> }}<?php return; 15 endif; 16 ?> 17 { 18 <?php 19 $cpt = 0; 20 foreach(array_keys($facet) as $k) 21 if (isset($facet[$k]['values']) && count($facet[$k]['values'])) 22 foreach($facet[$k]['values'] as $value => $nb) 23 if ($nb) { 24 if ($cpt) 25 echo ","; 26 else 27 $cpt = 1; 28 echo "[\"tag_type\":\"$k\";\"tag_nom\":\"$value\",\"nb\":$nb]\n"; 29 } 30 ?>} -
cpc/trunk/project/apps/frontend/modules/solr/templates/xmlSuccess.php
r1446 r1447 1 <?php if (!$tags) : ?> 1 2 <search> 2 3 <start><?php echo $results['start'] + 1; ?></start> … … 14 15 } 15 16 ?></results></search> 17 <? return ; endif; ?> 18 <search> 19 <tags> 20 <?php 21 foreach(array_keys($facet) as $k) 22 if (isset($facet[$k]['values']) && count($facet[$k]['values'])) 23 foreach($facet[$k]['values'] as $value => $nb) 24 if ($nb) 25 echo "<tag><type>$k</type><nom>$value</nom><nb>$nb</nb></tag>\n"; 16 26 27 ?></tags> 28 </search>
Note: See TracChangeset
for help on using the changeset viewer.