Commit b92a605f authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed elastic search scan order. #261

parent ba7eeb32
Pipeline #68354 passed with stages
in 17 minutes and 1 second
from nomad import config, infrastructure, search
config.elastic.host = 'localhost'
config.elastic.port = 19202
config.elastic.index_name = 'fairdi_nomad_prod_v0_7'
infrastructure.setup_logging()
infrastructure.setup_elastic()
req = search.SearchRequest()
req.search_parameter('authors', 'Emre Ahmetcik')
upload_id = None
i = 0
for entry in req.execute_scan(order_by='upload_id', size=1000):
i += 1
if entry['upload_id'] != upload_id:
upload_id = entry['upload_id']
print(upload_id, i)
......@@ -569,6 +569,8 @@ class SearchRequest:
else:
search = search.sort('-%s' % order_by_quantity.elastic_field)
search = search.params(preserve_order=True)
for hit in search.params(**kwargs).scan():
yield hit.to_dict()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment