python - How to specify meta parameters in search query -


i using elasticsearch 2.2 , corresponding python api. can query like

res = es.search(index="test-index", body={"query": {"match_all": {}}}) 

that good. there meta parameters can specify query, shown on

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#_parameters_5

so basically, want execute query like

url = 'http://localhost:9200/tesindex/test/_search?from=%d&q=fielda=abc or fielda=pqr'%start  result =  requests.get(url).json() 

how specify query using elasticsearch python api?

you pass them keyword parameters:

res = es.search(index="test-index", body={"query": {"match_all": {}}},  from_=20, size=100, _source=false) 

reference: http://elasticsearch-py.readthedocs.org/en/2.2.0/api.html#elasticsearch.elasticsearch.search


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -