<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def index(self, index, field, value):
        "Search for records matching a value in an index service"
        params = {
            "q": value,
            # search index has '_' instead of '-' in field names ..
            "q.options": "{fields:['%s']}" % (field.replace('-', '_'))
        }

        response = self.get(self.config(index, 'search_url'), params=params)
        results = [hit['fields'] for hit in response.json()['hits']['hit']]

        for result in results:
            for key in result:
                result[key.replace('_', '-')] = result.pop(key)

        return results