Ticket #233: xapian_omegascript_addfilter_lower.diff
File xapian_omegascript_addfilter_lower.diff, 2.2 KB (added by , 17 years ago) |
---|
-
query.cc
712 712 enum tagval { 713 713 CMD_, 714 714 CMD_add, 715 CMD_addfilter, 715 716 CMD_allterms, 716 717 CMD_and, 717 718 CMD_cgi, … … 753 754 CMD_list, 754 755 CMD_log, 755 756 CMD_lookup, 757 CMD_lower, 756 758 CMD_lt, 757 759 CMD_map, 758 760 CMD_max, … … 824 826 //name minargs maxargs evalargs ensure 825 827 {"",{CMD_, N, N, 0, 0}},// commented out code 826 828 T(add, 0, N, N, 0), // add a list of numbers 829 T(addfilter, 1, 1, N, 0), // add filter term 827 830 T(allterms, 0, 1, N, 0), // list of all terms matching document 828 831 T(and, 1, N, 0, 0), // logical shortcutting and of a list of values 829 832 T(cgi, 1, 1, N, 0), // return cgi parameter value … … 867 870 T(list, 2, 5, N, 0), // pretty print list 868 871 T(log, 1, 2, 1, 0), // create a log entry 869 872 T(lookup, 2, 2, N, 0), // lookup in named cdb file 873 T(lower, 1, 1, N, 0), // convert string to lower case 870 874 T(lt, 2, 2, N, 0), // test < 871 875 T(map, 1, 2, 1, 0), // map a list into another list 872 876 T(max, 1, N, N, 0), // maximum of a list of values … … 1050 1054 value = int_to_string(total); 1051 1055 break; 1052 1056 } 1057 case CMD_addfilter: { 1058 add_bterm(args[0]); 1059 break; 1060 } 1053 1061 case CMD_allterms: { 1054 1062 // list of all terms indexing document 1055 1063 int id = q0; … … 1449 1457 close(fd); // FIXME: cache fds? 1450 1458 break; 1451 1459 } 1460 case CMD_lower: { 1461 value = Xapian::Unicode::tolower(args[0]); 1462 break; 1463 } 1452 1464 case CMD_lt: 1453 1465 if (string_to_int(args[0]) < string_to_int(args[1])) 1454 1466 value = "true"; -
docs/omegascript.rst
59 59 ${...} 60 60 commented out code 61 61 62 $addfilter{term} 63 add a filter term, similar to passing a B CGI variable 64 62 65 $allterms{docid} 63 66 list of all terms matching document 64 67 … … 241 244 "tld_en" with "tld_$or{$opt{lang},en}" and automatically translate 242 245 into the currently set language, or English if no language is set. 243 246 247 $lower{STUFF} 248 return stuff converted to lower case 249 244 250 $map{LIST,STUFF) 245 251 map a list into the evaluated argument. If "LIST" is 246 252 1, 2 then::