Fix #97: Show index in Json output.

This commit is contained in:
Arun Prakash Jana 2016-11-27 07:46:54 +05:30
parent 314ee1c840
commit f1dd53f1bb
No known key found for this signature in database
GPG Key ID: A75979F35C080412

View File

@ -1919,6 +1919,7 @@ def format_json(resultset, single_record=False, field_filter=0):
elif field_filter == 3:
marks['title'] = row[2]
else:
marks['index'] = row[0]
marks['uri'] = row[1]
marks['title'] = row[2]
marks['description'] = row[4]
@ -1933,7 +1934,7 @@ def format_json(resultset, single_record=False, field_filter=0):
elif field_filter == 3:
record = {'title': row[2]}
else:
record = {'uri': row[1], 'title': row[2],
record = {'index': row[0], 'uri': row[1], 'title': row[2],
'description': row[4], 'tags': row[3][1:-1]}
marks.append(record)