anchor.diff:  				"recentLast")) {
   			SQLOrder = "r.test_date ASC";
   		} else if (request.getParameter("SEARCHTYPE").equals("relevant")) {
  -			SQLOrder = "rank" ;
  +			SQLOrder = "rank desc" ;
   			//SQL order by  Rank(record_id) = 6*frequency(patient_name) + 3*frequency(diagnosis) + frequency(description)
   		}
   	} else {
  
positive.code: 
  			out.println("Records for keyword(s): " + kWord
  					+ " between dates " + kTime1 + " and " + kTime2);
  			//String[] wordList = kWord.split(" ");
  
  			sql = sql + "r.test_date between to_date('" + kTime1
  					+ "', 'DD/MM/YYYY') AND to_date('" + kTime2
  					+ "', 'DD/MM/YYYY') AND ";
  
  			int count_contains = 0;
  			for (int i = 0; i < wordList.length; i++) {
  				sql = sql + class_id + "r.DIAGNOSIS ='" + wordList[i]
  						+ "' or p.LAST_NAME = '" + wordList[i]
  						+ "' or p.first_name = '" + wordList[i]
  						+ "'or r.DESCRIPTION like '%" + wordList[i] + "%'";
  				if (i != wordList.length - 1)
  					sql = sql + "OR ";
  				count_contains += 4;
  			}
  			sql = sql + "ORDER BY " + SQLOrder;
  
  
negative.code: 		if (kWord != "" && kTime1 != "" && kTime2 != "") {
  		sql = sql + ", ";
  		String[] wordList = kWord.split(" ");
  		int matchNum = 0;
  		for (int i = 0; i < wordList.length; i++) {
  			sql = sql + "6*score("+ Integer.toString(matchNum+1) +")+6*score("+ Integer.toString(matchNum+2) +")+3*score("+ Integer.toString(matchNum+3) +")+score("+ Integer.toString(matchNum+4)+") ";
  							
  			if (i != wordList.length - 1)
  				sql = sql + "+ ";
  			matchNum = matchNum + 4;
  		}
  		sql = sql + "as rank ";
  
  