NIHVIVO-1187 Migrate handling of empty or invalid query from PagedSearchController to FreemarkerPagedSearchController
This commit is contained in:
parent
a3f4487a90
commit
51e294d1af
7 changed files with 138 additions and 35 deletions
|
@ -0,0 +1,7 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<div class="contents searchFailed">
|
||||
<p class="warning">Your query '${query}' was invalid. Please modify your search and try again.</p>
|
||||
|
||||
<#include "search-form.ftl">
|
||||
</div>
|
19
webapp/web/templates/freemarker/body/search/search-form.ftl
Normal file
19
webapp/web/templates/freemarker/body/search/search-form.ftl
Normal file
|
@ -0,0 +1,19 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<div class="contents searchForm">
|
||||
|
||||
<div class="advancedSearchForm">
|
||||
<form name="filterForm" method="post" action="search">
|
||||
<h3>Search</h3>
|
||||
<input class="top_padded" name="querytext" value="" type="text" size="50" />
|
||||
<p><input class="form-button" value="Search" type="submit"/></p>
|
||||
</form>
|
||||
</div><!--advancedSearchForm-->
|
||||
|
||||
<div class="searchTips">
|
||||
<#include "search-help.ftl">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
${stylesheets.addFromTheme("/css/search.css")}
|
18
webapp/web/templates/freemarker/body/search/search-help.ftl
Normal file
18
webapp/web/templates/freemarker/body/search/search-help.ftl
Normal file
|
@ -0,0 +1,18 @@
|
|||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||
|
||||
<h3>Search Tips</h3>
|
||||
<ul>
|
||||
<li>Use short, single terms unless your searches are returning too many results</li>
|
||||
<li>When you enter more than one term, the search will look for records containing <strong>all</strong> of them unless you add the word "OR" between your terms.</li>
|
||||
<li>"NOT" can help limit searches -- e.g., <i>climate NOT change</i></li>
|
||||
<li>Except for boolean operators, searches are <strong>not</strong> case-sensitive, so "Geneva" and "geneva" are equivalent</li>
|
||||
<li>Enclose a phrase in quotes (") to search for the whole phrase, not individual words (e.g., "protein folding") -- <i>both leading and ending quotes are required</i></li>
|
||||
<li>Phrase searches may be combined with boolean operators: <i>"climate change" OR "global warming"</i></li>
|
||||
<li>The search uses <strong>stemming</strong> by default so that close word variations will also be found (e.g., "sequence" also matches "sequences" and "sequencing").
|
||||
Use the wildcard <strong>*</strong> character to match wider variation (e.g., <strong>nano*</strong> to match both
|
||||
<i>nanotechnology</i> and <i>nanofabrication</i>), but note that searching uses <i>stemmed</i>, or shortened, versions of words,
|
||||
so "cogniti*" finds nothing while "cognit*" finds both <i>cognitive</i> and <i>cognition</i></li>
|
||||
<li>If you're not sure of the spelling, put a <strong>~</strong> at the end -- e.g., <i>cabage~</i> finds <i>cabbage</i>,
|
||||
<i>steven~</i> finds <i>Stephen</i> and <i>Stefan</i> (as well as a few unwanted extra words)</li>
|
||||
<li>To match a person or unit's primary entry, enter <i>name: Smith</i> or <i>name: Biology</i></li>
|
||||
</ul>
|
35
webapp/web/templates/search/searchBadQuery.jsp
Normal file
35
webapp/web/templates/search/searchBadQuery.jsp
Normal file
|
@ -0,0 +1,35 @@
|
|||
<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %>
|
||||
<%@ page errorPage="/error.jsp"%>
|
||||
<% /***********************************************
|
||||
Used when the search results are empty.
|
||||
|
||||
request.attributes:
|
||||
|
||||
request.parameters:
|
||||
None yet.
|
||||
|
||||
Consider sticking < % = MiscWebUtils.getReqInfo(request) % > in the html output
|
||||
for debugging info.
|
||||
|
||||
**********************************************/
|
||||
%>
|
||||
<c:set var='lists' value='${requestScope.collatedResultsLists}'/>
|
||||
<c:set var='groupNames' value='${requestScope.collatedGroupNames}'/>
|
||||
<c:set var='portal' value='${requestScope.portal}'/>
|
||||
<c:set var='portalBean' value='${requestScope.portalBean}'/>
|
||||
<c:set var='portalId' scope='request' value='${portalBean.portalId}'/>
|
||||
<c:set var='entitiesListJsp' value='/templates/entity/entityList.jsp'/>
|
||||
<div id="content">
|
||||
<div class="contents searchFailed">
|
||||
<p class="warning">
|
||||
<c:out value='${requestScope.message}'
|
||||
default="Your query '${queryStr}' was invalid. Please modify your search and try again."
|
||||
escapeXml='false'/>
|
||||
|
||||
</p>
|
||||
|
||||
<jsp:include page="searchForm.jsp"/>
|
||||
</div><!-- contents -->
|
||||
</div><!-- content -->
|
Loading…
Add table
Add a link
Reference in a new issue