Permalink
Browse files

return all fields

for development, always return fields values
  • Loading branch information...
1 parent 5c20362 commit 796b9fa881ea859e168a11ad180ca384bdc963db @hokuma committed Sep 25, 2016
Showing with 8 additions and 1 deletion.
  1. +8 −1 nozama-cloudsearch-data/nozama/cloudsearch/data/document.py
@@ -149,13 +149,20 @@ def search(query={}):
took=0,
)
+ hit = []
+ conn = db().conn()
+ for i in results['hits']['hits']:
+ query = dict(_id=i['_id'])
+ fields = conn.documents.find_one(query)['fields']
+ hit.append({"id": i['_id'], "fields": fields})
+
rc = {
"rank": "-text_relevance",
"match-expr": "(label '{0}')".format(qstring),
"hits": {
"found": results['hits']['total'],
"start": 0,
- "hit": [{"id": i['_id']} for i in results['hits']['hits']]
+ "hit": hit
},
"info": {
"rid": os.urandom(40).encode('hex'),

0 comments on commit 796b9fa

Please sign in to comment.