I have this python code that get results from ElasticSearch
from elasticsearch import Elasticsearch
es = Elasticsearch([{'host':'127.0.0.1' , 'port' : 1234}])
query = 'name:Jon'
es.search(index='MyIndex' , q=query , size =50)
That works ! but ...
- How can I get only results from last 2 days?
- How can I get results sorted by news item first?