From: Sverre B. <sv...@us...> - 2005-11-03 13:25:54
|
Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/seal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25466/lib/seal Modified Files: nutch.inc Log Message: RFE1346889 Google-like result presentation Index: nutch.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/seal/nutch.inc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** nutch.inc 20 Oct 2005 10:40:48 -0000 1.8 --- nutch.inc 3 Nov 2005 13:25:29 -0000 1.9 *************** *** 61,66 **** var $sort; var $debug; - var $supressduplicates; var $morepages; /** --- 61,67 ---- var $sort; var $debug; var $morepages; + var $dedupfield; + var $hitsperdup; /** *************** *** 77,82 **** $this->offset = 0; $this->timespent = 0; ! $this->unsetSupressDuplicates(); ! $this->morepages = false; } --- 78,83 ---- $this->offset = 0; $this->timespent = 0; ! $this->morepages = false; ! $this->setDedup(); } *************** *** 116,120 **** # e.g &dedupField=date&hitsPerDup=100&sort=date if ($sortorder == "ascending" or $sortorder == "descending") { ! $this->sort = "&dedupField=date&sort=date"; if ($sortorder == "descending") { $this->sort .= "&reverse=true"; --- 117,122 ---- # e.g &dedupField=date&hitsPerDup=100&sort=date if ($sortorder == "ascending" or $sortorder == "descending") { ! $this->setDedup(100, "date"); ! $this->sort = "&sort=date"; if ($sortorder == "descending") { $this->sort .= "&reverse=true"; *************** *** 123,140 **** } - - /** - * Set suppress duplicate urls - */ - function setSupressDuplicates() { - $this->supressduplicates = "&hitsPerDup=1&dedupField=exacturl"; - } ! /** ! * Unset suppress duplicate urls ! */ ! function unsetSupressDuplicates() { ! $this->supressduplicates = "&hitsPerDup=0"; ! } /** --- 125,142 ---- } ! /** ! * Set deduplication ! * ! * If dedupfield is emty, NutchWax defaults to 'site' ! * To turn off dedup, set hitsperdup to 0 ! * ! * @param integer Hits per duplicate ! * @param string Field to deduplicate on ! */ ! function setDedup($hitsperdup = 0, $dedupfield = "") { ! $this->hitsperdup = $hitsperdup; ! $this->dedupfield = $dedupfield; ! } /** *************** *** 171,175 **** $time_start = microtime_float(); ! $this->queryurl = $this->searchengineurl . "?query=" . $this->adaptQuery($this->query) . "&start=" . $this->offset . "&hitsPerPage=" . $this->hitsperset . $this->supressduplicates; if ($this->sort != "") { --- 173,177 ---- $time_start = microtime_float(); ! $this->queryurl = $this->searchengineurl . "?query=" . $this->adaptQuery($this->query) . "&start=" . $this->offset . "&hitsPerPage=" . $this->hitsperset . "&hitsPerDup=" . $this->hitsperdup . "&dedupField=" . $this->dedupfield; if ($this->sort != "") { *************** *** 287,291 **** $this->resultset[$this->hitno]['encoding'] .= $data; } ! break; } } --- 289,298 ---- $this->resultset[$this->hitno]['encoding'] .= $data; } ! break; ! case "NUTCH:SITE": ! if (in_array("site", $this->resultfields)) { ! $this->resultset[$this->hitno]['site'] .= $data; ! } ! break; } } |