Commit 476633f8 authored by Maria  Di Girolamo's avatar Maria Di Girolamo
Browse files

test

parent 948e7eff
Pipeline #16124 passed with stage
in 2 minutes and 22 seconds
import requests
from elasticsearch import Elasticsearch
import json
es = Elasticsearch([{'host':'localhost', 'port':9200}])
res=requests.get('http://localhost:9200')
i=0
while i==200:
e={
"first_name":"asd",
"last_name":"pafdfd",
"age": 27+i,
"about": "Love to play football",
"interests": ['sports','music'],
}
if not es.indices.exists('test'):
es.indices.create(index='test', body=e,id=i)
else:
es.indices.index(index='test', body=e,id=i)
#print(r.status_code)
S
#break
i=i+1
query_all = {'size':300, 'query': {'match_all': {}}}
res= es.search(index='release',body=query_all)
for hit in res['hits']['hits']:
print hit['_source']['about']
print hit['_score']
print '**********************'
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