4

Is there a way to specify the search type when using pyelasticsearch? There's nothing in the documentation for 'scan', 'scroll', 'query_and_fetch', etc. Running the following code:

from pyelasticsearch import ElasticSearch
es = ElasticSearch(...)

query = {
    "query" : {
        "term" : { "DocContent" : "the" }
    }
}
x = es.search(query, index='main', search_type='scan', scroll='1m')

Produces the following error:

E:\query>python query.py
Traceback (most recent call last):
  File "query.py", line 11, in <module>
    x = es.search(query, index='main', scroll='1m', document_type='scan')
  File "C:\Python27\lib\site-packages\pyelasticsearch-0.7.1-py2.7.egg\pyelasticsearch\client.py", line 96, in decorate
    return func(*args, query_params=query_params, **kwargs)
  File "C:\Python27\lib\site-packages\pyelasticsearch-0.7.1-py2.7.egg\pyelasticsearch\client.py", line 591, in search
    return self._search_or_count('_search', query, **kwargs)
TypeError: _search_or_count() got an unexpected keyword argument 'search_type'
Cam S
  • 115
  • 1
  • 4

1 Answers1

0

Look like you got an old pyleasticsearch lib, update or else :(

James
  • 13,571
  • 6
  • 61
  • 83