Changeset - e2b9731cb2fb
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2019-11-09 19:13:41
mads@kiilerich.com
Grafted from: 1d6bfaf60b96
search: fix "'' is not unicode" when searching for wildcards

Seen when search matches on an empty list of unicode matches and the joining ''
thus isn't coerced to u'' - seen for example on
http://localhost:5000/_admin/search?q=*a*&type=content .
1 file changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/indexers/__init__.py
Show inline comments
 
@@ -200,14 +200,13 @@ class WhooshResultWrapper(object):
 

	
 
        log.debug('result: %s', res)
 

	
 
        return res
 

	
 
    def get_short_content(self, res, chunks):
 

	
 
        return ''.join([res['content'][chunk[0]:chunk[1]] for chunk in chunks])
 
        return u''.join([res['content'][chunk[0]:chunk[1]] for chunk in chunks])
 

	
 
    def get_chunks(self):
 
        """
 
        Smart function that implements chunking the content
 
        but not overlap chunks so it doesn't highlight the same
 
        close occurrences twice.
0 comments (0 inline, 0 general)