truemped/doppler — Issue #1: Highlighting is missing.
Author: hagentoennies
Created: 2012-02-15 08:12:05+00:00
State: open

Is it possible that the the Highlighting functionality is missing ? Here is something we had in mind.

class Highlighting(BaseQuery):
"""
The most simple Solr query: `hl`.
"""

def __init__(self, fields, fragsize=100, pre='', post=''):
"""
Initialize the query value.
"""
self.__fields = fields
self.__pre = pre
self.__post = post
self.__fragsize = fragsize

def get_params(self):
"""
Return the list of query params.
"""
result_list = list()
result_list.append(('hl', 'true'))
result_list.append(('hl.fl', ",".join(self.__fields)))
result_list.append(('hl.simple.pre', self.__pre))
result_list.append(('hl.simple.post', self.__post))
result_list.append(('hl.fragsize', self.__fragsize))
return result_list