Some forms can have Input boxes organized in groups so that you can perform a
query using a predefined hierarchy of Boolean operators, likewise using parentheses.
For more information see the document on Boolean Operators
and freeWAIS-sf
Because of how the Boolean operators are managed by SFgate, (see also How to Perform Serach in More Than a Field), it is always better to
restrict each group at no more than 2 fields like in the examples below.
In the following example
the query will be processed this way:
Here you can inspect the .fmt file, while the relevant parts of this form source code is here:
<FORM METHOD=POST ACTION="/htbin/SFgate">
<INPUT NAME="database" TYPE="hidden" VALUE="local//usr/local/wais-sources/telethon/telethon">
<CENTER>
<TABLE BORDER WIDTH=70%>
<TR><TH> </TH><TH>
<TABLE WIDTH="100%">
<TR><TH COLSPAN=3 align=left><FONT SIZE="+2">Fields Group 1</FONT></TH></TR>
<TR><TD><SELECT NAME="fieldsel_1_description">
<OPTION SELECTED>Title of the Project
<OPTION>Investigator
<OPTION>Department
<OPTION>City
<OPTION>Classification of the Project
<OPTION>Grant
</SELECT></TD>
<TD><INPUT TYPE="text" NAME="fieldsel_1_content" VALUE="alport" SIZE=40></TD>
<TD><SELECT NAME="fieldsel_1_tie">
<OPTION>and
<OPTION SELECTED>or
</SELECT>
</TD></TR>
<TR><TD><SELECT NAME="fieldsel_2_description">
<OPTION>Title of the Project
<OPTION SELECTED>Investigator
<OPTION>Department
<OPTION>City
<OPTION>Classification of the Project
<OPTION>Grant
</SELECT></TD>
<TD WIDTH=50%><INPUT TYPE="text" NAME="fieldsel_2_content" VALUE="salviati" SIZE=40></TD></TR>
</TABLE>
<TR><TD>
<SELECT NAME="group_2_tie">
<OPTION>and
<OPTION>or
</SELECT>
</TD></TR>
<TR><TH> </TH><TH>
<TABLE ALIGN=left>
<TR><TH COLSPAN=4 align=left><FONT SIZE=+2>Fields Group 2</FONT></TH></TR>
<TR><TD><SELECT NAME="fieldsel_3_description">
<OPTION>Time Extension
<OPTION>Renewals
<OPTION SELECTED>Financial Support
</SELECT></TD>
<TD><SELECT NAME="fieldsel_3_p">
<OPTION SELECTED> >
<OPTION> >=
<OPTION> ==
<OPTION> <=
<OPTION> <
</SELECT></TD>
<TD><INPUT TYPE="text" NAME="fieldsel_3_content" VALUE="100" SIZE=3 MAXLENGHT=3></TD>
<TD><SELECT NAME="fieldsel_3_tie">
<OPTION>and
<OPTION>or
</SELECT></TD>
<TD><SELECT NAME="fieldsel_4_description">
<OPTION>Time Extension
<OPTION>Renewals
<OPTION SELECTED>Financial Support
</SELECT></TD>
<TD><SELECT NAME="fieldsel_4_p">
<OPTION> >
<OPTION> >=
<OPTION> ==
<OPTION> <=
<OPTION SELECTED> <
</SELECT></TD>
<TD COLSPAN=2><INPUT TYPE="text" NAME="fieldsel_4_content" VALUE="200" SIZE=3 MAXLENGHT=3></TD></TR>
</TABLE>
</TH></TR>
</TABLE>
</CENTER>
<INPUT TYPE="hidden" NAME="fieldsel_name_title" VALUE="Title of the Project">
<INPUT TYPE="hidden" NAME="fieldsel_name_investigator" VALUE="Investigator">
<INPUT TYPE="hidden" NAME="fieldsel_name_department" VALUE="Department">
<INPUT TYPE="hidden" NAME="fieldsel_name_city" VALUE="City">
<INPUT TYPE="hidden" NAME="fieldsel_name_classification" VALUE="Classification of the Project">
<INPUT TYPE="hidden" NAME="fieldsel_name_grant" VALUE="Grant">
<INPUT TYPE="hidden" NAME="fieldsel_name_time-ext" VALUE="Time Extension">
<INPUT TYPE="hidden" NAME="fieldsel_name_renewals" VALUE="Renewals">
<INPUT TYPE="hidden" NAME="fieldsel_name_amount" VALUE="Financial Support">
<INPUT TYPE="hidden" NAME="group_1" VALUE="fieldsel_1, fieldsel_2">
<INPUT TYPE="hidden" NAME="group_2" VALUE="fieldsel_3, fieldsel_4">
<CENTER>
<TABLE>
<TR>
<TH><INPUT TYPE="submit" VALUE="Start Search">
</TH><TH> </TH><TH>
<INPUT TYPE="reset" VALUE="Reset Query"></TH></TR>
</TABLE>
</CENTER>
<P>
<INPUT TYPE="hidden" NAME="tieinternal" VALUE="and">
<INPUT TYPE="hidden" NAME="application" VALUE="projects">
<INPUT TYPE="hidden" NAME="convert" VALUE="Table">
<INPUT TYPE="hidden" NAME="listenv" VALUE="table">
<INPUT TYPE="hidden" NAME="range" VALUE="1">
</FORM>
The important parts of this form are:
<INPUT TYPE="hidden" NAME="fieldsel_name_title" VALUE="Title of the Project"> <INPUT TYPE="hidden" NAME="fieldsel_name_investigator" VALUE="Investigator"> <INPUT TYPE="hidden" NAME="fieldsel_name_department" VALUE="Department"> <INPUT TYPE="hidden" NAME="fieldsel_name_city" VALUE="City"> <INPUT TYPE="hidden" NAME="fieldsel_name_classification" VALUE="Classification of the Project"> <INPUT TYPE="hidden" NAME="fieldsel_name_grant" VALUE="Grant"> <INPUT TYPE="hidden" NAME="fieldsel_name_time-ext" VALUE="Time Extension"> <INPUT TYPE="hidden" NAME="fieldsel_name_renewals" VALUE="Renewals"> <INPUT TYPE="hidden" NAME="fieldsel_name_amount" VALUE="Financial Support"> <INPUT TYPE="hidden" NAME="group_1" VALUE="fieldsel_1, fieldsel_2"> <INPUT TYPE="hidden" NAME="group_2" VALUE="fieldsel_3, fieldsel_4">