Changeset 8255

Show
Ignore:
Timestamp:
02/26/10 16:57:14 (5 months ago)
Author:
ssterling
Message:

Added to the Solr Search Results Page some text describing the user query.

Location:
head/ambra/webapp/src/main
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • head/ambra/webapp/src/main/java/org/topazproject/ambra/search2/action/SearchAction.java

    r8239 r8255  
    6868  private Collection<SearchHit> searchResults; 
    6969  private int totalNoOfResults; 
    70  
     70  private boolean isSimpleSearch = false; 
    7171  // Creates list of all searchable Journals 
    7272  private Set<Journal> journals; 
     
    8181  public String executeSimpleSearch() { 
    8282    setDefaultsCommon(); // journalOpt and limitToJournal are NOT set in form in global_header.ftl 
     83    isSimpleSearch = true; 
    8384 
    8485    final String queryString = getSearchParameters().getQuery(); 
     
    268269  } 
    269270 
     271  public boolean getIsSimpleSearch() { 
     272    return isSimpleSearch; 
     273  } 
     274 
    270275  /** 
    271276   * @param noSearchFlag the noSearchFlag to set 
  • head/ambra/webapp/src/main/webapp/search2/searchResults.ftl

    r8246 r8255  
    108108        <p> 
    109109        Viewing results <strong>${startIndex + 1} - ${noOfResults}</strong> 
    110         of <strong>${totalNoOfResults}</strong> results, 
     110        of <strong>${totalNoOfResults}</strong> results, sorted by relevance, 
    111111      </#if> 
    112112 
    113       <#if (! limitToJournal??) || (limitToJournal?size < 1)> 
    114         sorted by relevance.</p> 
    115       <#elseif journalOpt?? && journalOpt = "all"> 
    116         sorted by relevance, in the journals 
    117         <#list journals as journal> 
    118           <#if ! journal_has_next>and</#if> 
    119           <strong>${journal.dublinCore.title}</strong><#if journal_has_next>,<#else>.</#if> 
    120         </#list> 
    121       <#elseif (limitToJournal?size > 1)> 
    122         <#assign journalNamesShownCounter = 1> 
    123         sorted by relevance, in the journals 
    124         <#list journals as journal> 
    125           <#if limitToJournal?seq_contains(journal.eIssn)> 
    126             <#if journalNamesShownCounter == limitToJournal?size>and</#if> 
    127             <strong>${journal.dublinCore.title}</strong><#if (journalNamesShownCounter < limitToJournal?size) && (limitToJournal?size > 2)>,</#if><#if journalNamesShownCounter == limitToJournal?size>.</#if> 
    128             <#assign journalNamesShownCounter = journalNamesShownCounter + 1> 
    129           </#if> 
    130         </#list> 
     113      <#if isSimpleSearch> 
     114        <#if (! limitToJournal??) || (limitToJournal?size < 1)> 
     115          for <strong>${query?html}</strong>.</p> 
     116        <#else> 
     117          for <strong>${query?html}</strong> in the journal 
     118          <#list journals as journal><#if limitToJournal?seq_contains(journal.eIssn)><strong>${journal.dublinCore.title}</strong></#if></#list>.</p> 
     119        </#if> 
    131120      <#else> 
    132         sorted by relevance, in the journal 
    133         <#list journals as journal><#if limitToJournal?seq_contains(journal.eIssn)><strong>${journal.dublinCore.title}</strong></#if></#list>. 
     121        for your search 
     122 
     123        <#assign isExistsPreviousQueryTerm = false> 
     124 
     125        <!--  Authors 
     126        --> 
     127        <#if creator?? && creator?size == 1 && creator?first?trim?length gt 0> 
     128          on the author 
     129          <#list creator as author> 
     130            <strong>${author?html}</strong> 
     131          </#list> 
     132          <#assign isExistsPreviousQueryTerm = true> 
     133        <#elseif creator?? && creator?size gt 0 && creator?first?trim?length gt 0> 
     134          <#if authorNameOp?? && authorNameOp == "all"> 
     135            on <strong>all</strong> of 
     136          </#if> 
     137          <#if authorNameOp?? && authorNameOp == "any"> 
     138            on <strong>any</strong> of 
     139          </#if> 
     140          the authors 
     141          <#list creator as author> 
     142            <#if ! author_has_next>and</#if> 
     143            <strong>${author?html}</strong><#if author_has_next && creator?size gt 2>,</#if> 
     144          </#list> 
     145          <#assign isExistsPreviousQueryTerm = true> 
     146        </#if> 
     147 
     148        <#assign isExistsPreviousWhereTheWordsQueryTerm = false> 
     149         
     150        <!--  At Least One of The Words 
     151        --> 
     152        <#if textSearchAtLeastOne?? && textSearchAtLeastOne?length gt 0> 
     153          <#if isExistsPreviousQueryTerm> 
     154            and 
     155          <#else> 
     156            on 
     157          </#if> 
     158          at least one of the words <strong>${textSearchAtLeastOne?html}</strong> 
     159          <#assign isExistsPreviousQueryTerm = true> 
     160          <#assign isExistsPreviousWhereTheWordsQueryTerm = true> 
     161        </#if> 
     162 
     163        <!--  All The Words 
     164        --> 
     165        <#if textSearchAll?? && textSearchAll?length gt 0> 
     166          <#if isExistsPreviousQueryTerm> 
     167            and 
     168          <#else> 
     169            on 
     170          </#if> 
     171          all of the words <strong>${textSearchAll?html}</strong> 
     172          <#assign isExistsPreviousQueryTerm = true> 
     173          <#assign isExistsPreviousWhereTheWordsQueryTerm = true> 
     174        </#if> 
     175 
     176        <!--  Exact Phrase 
     177        --> 
     178        <#if textSearchExactPhrase?? && textSearchExactPhrase?length gt 0> 
     179          <#if isExistsPreviousQueryTerm> 
     180            and 
     181          <#else> 
     182            on 
     183          </#if> 
     184          the exact phrase "<strong>${textSearchExactPhrase?html}</strong>" 
     185          <#assign isExistsPreviousQueryTerm = true> 
     186          <#assign isExistsPreviousWhereTheWordsQueryTerm = true> 
     187        </#if> 
     188 
     189        <!--  Without The Words 
     190        --> 
     191        <#if textSearchWithout?? && textSearchWithout?length gt 0> 
     192          <#if isExistsPreviousQueryTerm> 
     193            but 
     194          </#if> 
     195          without any of the words <strong>${textSearchWithout?html}</strong> 
     196          <#assign isExistsPreviousQueryTerm = true> 
     197          <#assign isExistsPreviousWhereTheWordsQueryTerm = true> 
     198        </#if> 
     199 
     200        <!--  Where my Words Occur 
     201        --> 
     202        <#if isExistsPreviousWhereTheWordsQueryTerm && textSearchOption?? && textSearchOption?length gt 0> 
     203          where your words occur 
     204          <#if textSearchOption == "abstract"> 
     205            in article <strong>abstracts</strong> 
     206          <#elseif textSearchOption == "refs"> 
     207            in article <strong>references</strong> 
     208          <#elseif textSearchOption == "title"> 
     209            in article <strong>titles</strong> 
     210          <#else> 
     211            anywhere in the articles 
     212          </#if> 
     213        </#if> 
     214 
     215        <!--  Dates 
     216        --> 
     217        <#if startDateAsString?? && startDateAsString?length gt 0 && endDateAsString?? && endDateAsString?length gt 0 && startDateAsString != endDateAsString> 
     218          from <strong>${startDateAsString}</strong> to <strong>${endDateAsString}</strong> 
     219        </#if> 
     220 
     221        <!--  Subject Categories 
     222        --> 
     223        <#if subjectCatOpt?? && subjectCatOpt == "all"> 
     224<!-- 
     225          in <strong>all subject categories</strong><#if ( (! limitToJournal??) || (limitToJournal?size < 1) ) && (! (journalOpt?? && journalOpt == "all") )>.</p></#if> 
     226-->           
     227        <#else> 
     228          <#if limitToCategory?size == 1> 
     229            in the subject category 
     230            <#list limitToCategory as category> 
     231              <strong>${category?html}</strong><#if ( (! limitToJournal??) || (limitToJournal?size < 1) ) && (! (journalOpt?? && journalOpt == "all") )>.</p></#if> 
     232            </#list> 
     233          <#elseif limitToCategory?size gt 1> 
     234            in the subject categories 
     235            <#list limitToCategory as category> 
     236              <#if ! category_has_next>and</#if> 
     237              <strong>${category?html}</strong><#if category_has_next && limitToCategory?size gt 2>,<#else><#if ( (! limitToJournal??) || (limitToJournal?size < 1) ) && (! (journalOpt?? && journalOpt == "all") )>.</p></#if></#if> 
     238            </#list> 
     239          </#if> 
     240        </#if> 
     241 
     242        <!--  Journals 
     243        --> 
     244        <#if journalOpt?? && journalOpt == "all"> 
     245          in <strong>all</strong> of the journals. 
     246<!-- 
     247          <#list journals as journal> 
     248            <#if ! journal_has_next>and</#if> 
     249            <strong>${journal.dublinCore.title?html}</strong><#if journal_has_next>,<#else>.</#if> 
     250          </#list> 
     251--> 
     252        <#elseif (limitToJournal?size == 1)> 
     253          in the journal 
     254          <#list journals as journal><#if limitToJournal?seq_contains(journal.eIssn)><strong>${journal.dublinCore.title?html}</strong></#if></#list>. 
     255        <#elseif (limitToJournal?size > 1)> 
     256          <#assign journalNamesShownCounter = 1> 
     257          in the journals 
     258          <#list journals as journal> 
     259            <#if limitToJournal?seq_contains(journal.eIssn)> 
     260              <#if journalNamesShownCounter == limitToJournal?size>and</#if> 
     261              <strong>${journal.dublinCore.title?html}</strong><#if journalNamesShownCounter lt limitToJournal?size && limitToJournal?size gt 2>,<#elseif journalNamesShownCounter == limitToJournal?size>.</#if> 
     262              <#assign journalNamesShownCounter = journalNamesShownCounter + 1> 
     263            </#if> 
     264          </#list> 
     265        </#if> 
     266 
     267        </p> 
    134268      </#if> 
    135       </p> 
    136269    </#if> 
    137270     
     
    157290      </form> 
    158291 
     292      <@s.url id="searchHelpURL" includeParams="none" namespace="/static" action="searchHelp" /> 
     293 
     294      <#if isSimpleSearch> 
     295        <a href="#" onclick="document.reviseSearch.submit();return false;">Go to Advanced Search</a> to revise <em>or</em> 
     296        <label for="searchEdit" style="display:inline;">edit your query here</label> 
     297        (<a href="${searchHelpURL}">help</a>):&nbsp; 
     298        <form name="searchForm" action="${searchURL}" method="get"> 
     299          <input type="text" size="50" value="${query?html}" id="searchEdit" name="query"/> 
     300          <input type="submit"  value="Go" class="button"/> 
     301        </form> 
     302      <#else> 
    159303        <a href="#" onclick="document.reviseSearch.submit();return false;">Go to Advanced Search</a> 
    160         <@s.url id="searchHelpURL" includeParams="none" namespace="/static" action="searchHelp" /> 
    161         (<a href="${searchHelpURL}">old-style search help</a>) 
     304      </#if> 
     305 
     306      (<a href="${searchHelpURL}">help</a>) 
    162307    </div> 
    163308