From grdetil@scrc.umanitoba.ca Thu Jan 20 15:31:43 2000 Date: Thu, 20 Jan 2000 16:22:50 -0600 (CST) From: Gilles Detillieux To: htdig3-dev@htdig.org Subject: [htdig3-dev] call for votes, select list builder patch Can I ask for a vote on including my select list builder patch in 3.2.0b1? It's a pretty simple addition, but right now it lacks documentation. I don't know if my notes in the patch file are clear enough to use as the documentation for it, but I'm open to suggestions. I've had no feedback either way so far. However, it does seem to address a request that comes up rather often. Here's my +1 --- begin forwarded message, from bugs database --- From: Gilles Detillieux Subject: Re: New feature to add (PR#745) To: Severin.Terrier@univ-tlse1.fr Date: Thu, 20 Jan 2000 11:51:43 -0600 (CST) Cc: ht3bugs@htdig.org, htdig3-bugs@htdig.org According to Severin.Terrier@univ-tlse1.fr: > I use ht://dig V3.1.4, and i think there would a feature to add : > the search_algorithm attribut, that permit to choose if you whant exact > search, fuzzy search, or a combination of several is a good thing, but it > would be good if this option was reported in results files, to show (and > modify) in full (comprehensive) text them like you have $(FORMAT), > $(METHOD), ... > > a $(SEARCH_ALGORITHM) , or something like that whould then be good... You can already do this by adding "allow_in_form: search_algorithm" to your config file, which can turn any config attribute into an input parameter with a corresponding template variable. This will define the SEARCH_ALGORITHM template variable, for use in search forms. It will be defined simply as the value of the config attribute or input parameter, not as a select list. If you want to make a select list out of it, you could apply this patch ftp://sol.ccsf.cc.ca.us/htdig-patches/3.1.4/select.list and then define how you want the select list put together, following the example in that file. It lets you define select lists for any input parameter. This patch should eventually become part of the htsearch source, as it's an often requested feature. --- begin select.list patch, with minor revisions --- This patch implements a generalized \n"; vars.Add("SORT", str); vars.Add("SELECTED_SORT", new String(st)); + + // Handle user-defined select lists. + // Uses octuples containing these values: + // + // + // e.g.: + // METHOD_LIST method method_names 2 1 2 match_method "" + // FORMAT_LIST format template_map 3 2 1 template_name "" + // EXCLUDE_LIST exclude exclude_names 2 1 2 exclude "" + // MATCH_LIST matchesperpage matches_per_page_list 1 1 1 \ + // matches_per_page "Previous Amount" + QuotedStringList builds(config["build_select_lists"], " \t\r\n"); + for (int b = 0; b <= builds.Count()-8; b += 8) + { + int ntuple = atoi(builds[b+3]); + int ivalue = atoi(builds[b+4]); + int ilabel = atoi(builds[b+5]); + int nsel = 0; + QuotedStringList namelist(config[builds[b+2]], " \t\r\n"); + if (ntuple > 0 && ivalue > 0 && ivalue <= ntuple + && ilabel > 0 && ilabel <= ntuple && namelist.Count() % ntuple == 0) + { + str = new String(); + *str << "\n"; + vars.Add(builds[b], str); + } + } // // If a paged output is required, set the appropriate variables -- Gilles R. Detillieux E-mail: Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil Dept. Physiology, U. of Manitoba Phone: (204)789-3766 Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930 ------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev-unsubscribe@htdig.org You will receive a message to confirm this.