oceanprotocol / aquarius

🐋 Off-chain database store for data assets metadata.
Apache License 2.0
102 stars 45 forks source link

Search by type is not working #205

Closed jernejpregelj closed 5 years ago

jernejpregelj commented 5 years ago

Searching for assets that are specific type is not working.

POST at http://localhost:5000/api/v1/aquarius/assets/ddo/query

body:

{
    "offset":100,
    "page":1,
    "sort":{
        "created":-1
    },
    "query":{
        "type":["dataset"]
    }
}
jernejpregelj commented 5 years ago

Also tested with full path of type

diminator commented 5 years ago

I'm getting this with aquarius:v0.2.9 and squid-py:0.6.15

cc @ssallam

aquarius_1                   | 2019-07-10 14:50:17 a2a745afa71d flask.app[9] ERROR Exception on /api/v
1/aquarius/assets [GET]                                                                               
aquarius_1                   | Traceback (most recent call last):                                     
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2292
, in wsgi_app                                                                                         
aquarius_1                   |     response = self.full_dispatch_request()                            
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1815
, in full_dispatch_request                                                                            
aquarius_1                   |     rv = self.handle_user_exception(e)                                 
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask_cors/extension.py"
, line 161, in wrapped_function                                                                       
aquarius_1                   |     return cors_after_request(app.make_response(f(*args, **kwargs)))   
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1718
, in handle_user_exception                                                                            
aquarius_1                   |     reraise(exc_type, exc_value, tb)                                   
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 
35, in reraise                                                                                        
aquarius_1                   |     raise value                                                        
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1813
, in full_dispatch_request                                                                            
aquarius_1                   |     rv = self.dispatch_request()                                       
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1799
, in dispatch_request                                                                                 
aquarius_1                   |     return self.view_functions[rule.endpoint](**req.view_args)         
aquarius_1                   |   File "/aquarius/aquarius/app/assets.py", line 39, in get_assets      
aquarius_1                   |     asset_with_id = dao.get_all_listed_assets()                        
aquarius_1                   |   File "/aquarius/aquarius/app/dao.py", line 16, in get_all_listed_asse
ts                                                                                                    
aquarius_1                   |     assets = self.oceandb.list()                                       
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/oceandb_elasticsearch_dr
iver/plugin.py", line 128, in list                                                                    
aquarius_1                   |     body=body                                                          
aquarius_1                   |   File "/usr/local/lib/python3.6/site-packages/elasticsearch/client/uti
ls.py", line 84, in _wrapped                                                                          
aquarius_1                   |     return func(*args, params=params, **kwargs)                     
aquarius_1                   | TypeError: search() got an unexpected keyword argument 'doc_type'