Changeset 8534


Ignore:
Timestamp:
17/08/12 11:27:50 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22528: Migration of FAtCat Open Search link for HPFeld
 http://team.ceda.ac.uk/trac/ceda/ticket/22528

Implemented a search on the results. The 'q' parameter is assumed to be space separated words.
The application will look for any of the words in the title or in the description

Location:
mauRepo/HPFos/trunk/hpfos/HPFos
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/HPFos/trunk/hpfos/HPFos/osImpl/myimpl.py

    r8529 r8534  
    110110        return Result(count, start_index, start_page, tot_results, subresult = subresults, title=HPFOS_TITLE)         
    111111         
     112    def _check_text_filter(self, text, title, description): 
     113        words = text.split() 
     114        for word in words: 
     115            if word in title \ 
     116                or word in description: 
     117                    return True 
     118        return False 
     119         
    112120 
    113121    def digest_search_results(self, results, context):  
     
    142150            if result_guid is None: 
    143151                continue 
     152             
     153            if context['q'] is not None: 
     154                if not self._check_text_filter(context['q'], self._extractTitle(result), result.description): 
     155                    continue 
     156                 
    144157            ititle = self._extractTitle(result) 
    145158            item = Subresult(result_guid.id, ititle, datetime.now().isoformat(), description = result.description)                
  • mauRepo/HPFos/trunk/hpfos/HPFos/template/homeTemplate

    r8531 r8534  
    8080     "Times New Roman";mso-bidi-font-family:Calibri'>searchTerm</span></strong><span 
    8181     style='font-size:7.0pt;font-family:"Verdana","sans-serif";mso-fareast-font-family: 
    82      "Times New Roman"'>: the keyword or keywords desired by the search client 
    83      (not implemented yet) <o:p></o:p></span></li> 
     82     "Times New Roman"'>: the keyword or keywords (space separated) desired by the search client 
     83      <o:p></o:p></span></li> 
    8484 <li class=MsoNormal style='color:black;mso-margin-top-alt:auto;mso-margin-bottom-alt: 
    8585     auto;mso-list:l2 level1 lfo6;tab-stops:list 36.0pt'><strong><span 
Note: See TracChangeset for help on using the changeset viewer.