Ignore:
Timestamp:
2010-09-23T15:55:32+12:00 (14 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed more bugs tangentially related to the advanced searching combined with fielded searching bug that was previously crashing the library.cgi and server.exe. This time around, there were no crashes but the recent corrections to the combined searching needed to work with SQL queries as well. When testing this last, it was discovered that 1. the SQL form wasn't displaying in preferences even when sqlite was set as the infodbtype in collect.cfg and its format Searchtypes line set to include sqlform next to plain and form. This was fixed by making CGIWrapper remember to instantiate sqlqueryaction and not just queryaction. 2. the RunQuery button would eat commas on submission (previously choosing to turn them into non-descript spaces), this has now been fixed in the query.dm macro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/query.dm

    r22876 r22948  
    613613
    614614
    615 // convert commas and spaces to plus
    616 // also convert other illegal characters to %xx codes
     615// convert spaces to plus
     616// also convert other illegal characters (including commas) to %xx codes
     617// This routine used to treat commas like spaces (replacing them with a plus),
     618// but this is no longer good enough for handling sql-queries
    617619function format(string) \{
    618620   var str = "" + string;
     
    622624   for (j = 0; j < str.length; j++) \{
    623625       ch=str.charAt(j);
    624        if (ch == " "|| ch == ",") \{
     626       if (ch == " ") \{
    625627           if (flag == 0) \{     
    626628          out += "+";
     
    629631        continue;
    630632    \}
    631     if (ch == ";" || ch == ":" || ch == "/" || ch == "?" ||
     633    if (ch == "," || ch == ";" || ch == ":" || ch == "/" || ch == "?" ||
    632634            ch == "@" || ch == "&" || ch == "=" || ch == "#" ||
    633635        ch == "%") \{
     
    920922<p>For example:<br>
    921923<i>
    922   element in ('dc.Keywords') AND value='Farming'<br>
    923   element in ('dls.Title') AND value LIKE 'F%'<br>
    924   element in ('dls.Title') AND value<'F%'<br>
     924  element in (\'dc.Keywords\') AND value=\'Farming\'<br>
     925  element in (\'dls.Title\') AND value LIKE \'F%\'<br>
     926  element in (\'dls.Title\') AND value<\'F%\'<br>
    925927</i>
    926928)
Note: See TracChangeset for help on using the changeset viewer.