How can I serialize the entire result set from a search api query on GAE into json? I'm using python and the standard library.
Ive got my results :
index = search.Index(name=Myindex)
query_string = "amount > 0"
results = index.search(query_string)
json_results = {}
I was trying to iterate through them and construct a json output bit by bit,
for i in results:
x = {'result':
{'name' : i.field('name').value,
'value' : i.field('value').value
'geo' : i.field('location').value
}}
json_results = dict(list(json_results)+list(x))
json.dump(json_results,self.response.out)
but I'm totally new to coding and just teaching myself as I go along on this project...Ive tried all manner of variation in the last couple of days, to no avail. There must be a simple way.