From: Sverre B. <sv...@us...> - 2005-10-05 22:42:56
|
Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/seal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2379/lib/seal Modified Files: indexSearch.inc nutch.inc Log Message: Cleaning Index: indexSearch.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/seal/indexSearch.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** indexSearch.inc 4 Oct 2005 23:40:45 -0000 1.2 --- indexSearch.inc 5 Oct 2005 22:42:47 -0000 1.3 *************** *** 112,149 **** * Set query string for search * - * The query string must conform to the syntax - * outlined below. The query string may be in - * upper, lower or mixed case. - * - * Searching text indices: - * schema.index:"word" - Word match - * schema.index:"word*" - Right hand truncation, match for part of word - * schema.index:"phrase" - Phrase match - * - * Searching integer indices: - * schema.index:i - Exact match - * schema.index:[i;j] - Range(including boundaries) - * schema.index:[i;] - Larger than or equal to - * schema.index:[;i] - Smaller than or equal to - * schema.index:>i - Larger than - * schema.index:<i - Smaller than - * - * In the context of the NWA Access Module schema will be NWA. - * The index names will be defined by the NWA document format - * (http://nwa.nb.no/nwa/export/1.0/). - * - * Boolean operators: - * The NWA query language supports the boolean operators: AND, OR, ANDNOT - * - * Parenthesis: - * The left parenthesis "(" and right parenthesis ")" are used - * to dilineate one expression from another. For example, in the query - * - * dcdate:998690406 AND (title:"ouagadougou" - * OR title:"capitol of burkina fazo"), - * - * parentheses group the ORs together so they are as a distinct - * entity from the AND. - * * @param string Query string */ --- 112,115 ---- *************** *** 169,176 **** * This method will populate the result set array * Returns an array of the following form: ! * Array([0]=>Array([dcdate]=>"2001-10-14"[dctitle]=>"Some title") ! * [1]=>Array([dcdate]=>"2001-10-15"[dctitle]=>"Another title")) * the fields returned in the array is determined by the ! * setResultFields method (e.g. setResultFields("dcdate, dctitle") * * @return boolean False if error --- 135,142 ---- * This method will populate the result set array * Returns an array of the following form: ! * Array([0]=>Array([date]=>"20011014203201"[title]=>"Some title") ! * [1]=>Array([date]=>"20010816121407"[title]=>"Another title")) * the fields returned in the array is determined by the ! * setResultFields method (e.g. setResultFields("date, title") * * @return boolean False if error *************** *** 198,252 **** return $this->errormsg; } - - /** - * Get the result set - * - * The method will return an xml formatted result of the following form: - * - * <?xml version="1.0" encoding="utf-8"?> - * <resultset query="query" sortorder="descending" fields="dcdate, dctitle" hits=10 totalhits="112" spanstart="1" spanend="10" timespent="0.0017489194869995"> - * <doc id="1"> - * <dcdate></dcdate> - * <dctitle></dctitle> - * </doc> - * <doc id="2"> - * <dcdate></dcdate> - * <dctitle></dctitle> - * </doc> - * .. - * . - * </resultset> - * - * @return string Result set - */ - function getXmlResultSet() { - global $HTTP_SERVER_VARS; - $address = "http://" . $HTTP_SERVER_VARS["HTTP_HOST"] . $HTTP_SERVER_VARS["SCRIPT_NAME"]; - $resultsetarray=$this->getResultSet(); - $spanstart=$this->offset+1; - if ($this->numhitstotal==0) { - $spanend=""; - $spanstart=""; - } - elseif ($this->numhits < $this->hitsperset) { - $spanend=$this->offset+$this->numhits; - } - else { - $spanend=$this->offset+$this->hitsperset; - } - $retval='<?xml version="1.0" encoding="utf-8"?>'."\n"; - $retval.=sprintf('<resultset address="%s" query="%s" sortorder="%s" fields="%s" hits="%d" totalhits="%d" hitsperset="%d" offset="%d" spanstart="%d" spanend="%d" timespent="%s">', $address, $this->query, $this->sortorder, implode(" ", $this->resultfields), $this->numhits, $this->numhitstotal, $this->hitsperset, $this->offset, $spanstart, $spanend, $this->timespent) . "\n"; - - $i=$this->offset; - while (list($setkey,$result)=each($this->resultset)) { - $retval.=' <doc id="'.++$i.'">'."\n"; - while (list($key,$val)=each($result)) { - $retval.=" <".$key.">".$val."</".$key.">\n"; - } - $retval.=" </doc>\n"; - } - $retval.="</resultset>\n"; - return $retval; - } } ?> --- 164,167 ---- Index: nutch.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/seal/nutch.inc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nutch.inc 4 Oct 2005 23:40:45 -0000 1.2 --- nutch.inc 5 Oct 2005 22:42:47 -0000 1.3 *************** *** 198,203 **** if ($this->numhitstotal > 0) { foreach ($this->resultset as $key => $val) { ! if (in_array("dcformat", $this->resultfields)) { ! $this->resultset[$key]['dcformat'] = $this->mime[$key]['primary'] . "/" . $this->mime[$key]['sub']; } if (in_array("archiveidentifier", $this->resultfields)) { --- 198,203 ---- if ($this->numhitstotal > 0) { foreach ($this->resultset as $key => $val) { ! if (in_array("mime", $this->resultfields)) { ! $this->resultset[$key]['mime'] = $this->mime[$key]['primary'] . "/" . $this->mime[$key]['sub']; } if (in_array("archiveidentifier", $this->resultfields)) { *************** *** 283,292 **** break; case "NUTCH:PRIMARYTYPE": ! if (in_array("dcformat", $this->resultfields)) { $this->mime[$this->hitno]['primary'] .= $data; } break; case "NUTCH:SUBTYPE": ! if (in_array("dcformat", $this->resultfields)) { $this->mime[$this->hitno]['sub'] .= $data; } --- 283,292 ---- break; case "NUTCH:PRIMARYTYPE": ! if (in_array("mime", $this->resultfields)) { $this->mime[$this->hitno]['primary'] .= $data; } break; case "NUTCH:SUBTYPE": ! if (in_array("mime", $this->resultfields)) { $this->mime[$this->hitno]['sub'] .= $data; } |