Changeset 1688


Ignore:
Timestamp:
Oct 5, 2010, 8:15:52 PM (11 years ago)
Author:
goya
Message:

Pas de hightlight si pas de mot clés + truncate les interventions longues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/solr/actions/actions.class.php

    r1687 r1688  
    7373    $params = array('hl'=>'true', 'fl' => 'id,object_id,object_name,date,description', '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");
    7474    $this->sort_type = 'pertinence';
     75
     76    if (!$this->query) {
     77        $params['hl'] = 'false';
     78    }
    7579
    7680    $this->sort = $request->getParameter('sort');
     
    224228        $this->results['docs'][$i]['highlighting'] = preg_replace('/^'."$this->results['docs'][$i]['personne']".'/', '', implode('...', $high_res));
    225229      }
    226       else $this->results['docs'][$i]['highlighting'] = $this->results['docs'][$i]['description'];
     230      else {
     231        $this->results['docs'][$i]['highlighting'] = $this->results['docs'][$i]['description'];
     232        if (strlen($this->results['docs'][$i]['highlighting']) > 700)
     233           $this->results['docs'][$i]['highlighting'] = preg_replace('/[^ ]*$/', '', substr($this->results['docs'][$i]['description'], 0, 700)).'...';
     234      }
    227235    }
    228236   
Note: See TracChangeset for help on using the changeset viewer.