This section describes how to perform some common customizations on the Search provider.
Modify searchOnly.jsp file by adding last-modified to the list of viewAttributes.
For example:
<search:setViewAttributes viewAttributes="hl-url,hl-title,hl-description,score,content-length,hl-classification,last-modified"/> |
Modify results.jsp file to display the last-modified date for document results using the SOIF getValue tag.
For example:
<% if (formbean.getDescription().equals("full")) { %> <FONT color=<%=tFontColor%> face=<%=tFontFace%>><search:getValue soifAttribute="description" escape="false"/></FONT><BR> <FONT color=#707070 face=<%=tFontFace%>><search:getURL escape="true"/><BR> <search:getValue soifAttribute="content-length" id="sz"/> <search:getValue soifAttribute="last-modified"/><BR> <% } %> |
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
(Optional) Modify searchOnly.jsp file by removing content-length from the list of viewAttributes.
The line to modify is the following:
<search:setViewAttributes viewAttributes="hl-url,hl-title,hl-description,score,content-length,classification hl-classification"/> |
Remove content-length from this line.
Modify results.jsp file by removing the line that displays the content-length.
The line to modify is the following:
<% } else if (formbean.getDescription().equals("full")) { %> <FONT size=-1 color=<%=tFontColor%> face=<%=tFontFace%>><search:getValue soifAttribute="hl-description" escape="false"/></FONT><BR> <FONT size=-1 color=#707070 face=<%=tFontFace%>><search:getValue soifAttribute="hl-url" escape="false"/><BR> <search:getValue soifAttribute="content-length" id="sz"/> |
Remove <search:getValue soifAttribute="content-length" id="sz"/> from this file.
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
In this procedures, Steps 1 and 2 are independent of each other. If desired, run the touch command after Step 1 to see the results.
Modify results.jsp by changing the search status line to add the <search:getTotalDocuments/> tag.
For example:
<NOBR><B>Document matches <search:getFirstHit/> - <search:getToHit/> (of <search:getHitCount/>)</B> out of <search:getTotalDocuments/></NOBR><BR> |
This results in the following display:
Document matches 1 - 6 (of 6) out of 37 |
Change browseResults.jsp by adding the <search:getTotalDocuments/> tag to the search status.
For example:
<FONT color="<%=tFontColor%>" face="<%=tFontFace%>" size="-1"><b>Subcategories <search:getFirstHit/> - <search:getToHit/> (of <search:getHitCount/>)</B> out of <search:getTotalDocuments/></FONT><br> |
This results in the following display:
Category matches 1 - 2 (of 2) out of 86 |
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
Comment out or remove the author related HTML from the advancedSearch.jsp file.
For example:
<!-- --> <!-- To disclude the "author" row, remark out the following section --> <!-- --> <TR> <td valign=middle align=right height=40><FONT color=<%=tFontColor%> face=<%=tFontFace%>><nobr> <LABEL FOR="advAuthor">Author</LABEL> <SELECT NAME="authorOp"> <OPTION VALUE=<%=SearchContext.CONTAIN%> <%=formbean.authorOpSelection(SearchContext.CONTAIN)%>>does</OPTION> <OPTION VALUE=<%=SearchContext.NOTCONTAIN%> <%=formbean.authorOpSelection(SearchContext.NOTCONTAIN)%>>does not</OPTION> </SELECT>contain </FONT></nobr></TD> <td valign=middle align=left height=40><INPUT TYPE="text" NAME="authorVal" id="advAuthor" VALUE= "<%=SearchContext.htmlEncode(formbean.getAuthorVal())%>"></TD> </TR> |
Comment out author- related lines in advQuery.jsp file.
// h = new HashMap(); // h.put(SearchContext.OPERAND, "author"); // h.put(SearchContext.OPERATION, formbean.getAuthorOp()); // h.put(SearchContext.VALUE, formbean.getAuthorVal()); // l.add(h); h = new HashMap(); h.put(SearchContext.OPERAND, "title"); |
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
Uncomment the keywords section in advancedSearch.jsp file.
<!-- --> <!-- To Include the "Keywords" row, unremark the following section --> <!-- <TR> <td valign=middle align=right height=40><FONT color=<%=tFontColor%> face=<%=tFontFace%>><nobr> <LABEL FOR="advKeywords">Keywords</LABEL> <SELECT NAME="keywordsOp"> <OPTION VALUE=<%=SearchContext.CONTAIN%> <%=formbean.keywordsOpSelection(SearchContext.CONTAIN)%>>does</OPTION> <OPTION VALUE=<%=SearchContext.NOTCONTAIN%> <%=formbean.keywordsOpSelection(SearchContext.NOTCONTAIN)%>>does not</OPTION> </SELECT>contain </FONT></nobr></TD> <td valign=middle align=left height=40><INPUT TYPE="text" NAME="keywordsVal" id="advKeywords" VALUE= "<%=SearchContext.htmlEncode(formbean.getKeywordsVal())%>"></TD> </TR> --> |
Remove the <!-- and --> comment marks from this section.
Add the keywords to advQuery.jsp file.
h = new HashMap(); h.put(SearchContext.OPERAND, "keywords"); h.put(SearchContext.OPERATION, formbean.getKeywordsOp()); h.put(SearchContext.VALUE, formbean.getKeywordsVal()); l.add(h); |
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.