function query($q) { // Udm_Set_Agent_Param_Ex($this->agent, 'q', 'test'); $res=Udm_Find($this->agent,$q); $errno = Udm_Errno($this->agent); if ($errno) { throw new Exception(Udm_Error($this->agent), $errno); } $resultSet = new msearchResults($res, $this); return $resultSet; }
} } if (! $have_query_flag) { print_bottom(); return; } elseif ($have_query_flag && ($q=='')) { print ("<FONT COLOR=red>You should give at least one word to search for.</FONT>\n"); print_bottom(); return; } $res=Udm_Find($udm_agent,$q); if(($errno=Udm_Errno($udm_agent))>0){ print_error_local(Udm_Error($udm_agent)); } else { $found=Udm_Get_Res_Param($res,UDM_PARAM_FOUND); $rows=Udm_Get_Res_Param($res,UDM_PARAM_NUM_ROWS); $wordinfo=Udm_Get_Res_Param($res,UDM_PARAM_WORDINFO); $searchtime=Udm_Get_Res_Param($res,UDM_PARAM_SEARCHTIME); $first_doc=Udm_Get_Res_Param($res,UDM_PARAM_FIRST_DOC); $last_doc=Udm_Get_Res_Param($res,UDM_PARAM_LAST_DOC); if (!$found) { print ("Search Time: $searchtime<br>Search results:\n"); print ("<small>$wordinfo</small><HR><CENTER>Sorry, but search returned no results.<P>\n"); print ("<I>Try to produce less restrictive search query.</I></CENTER>\n"); print_bottom(); return;