Skip to content

Add option to filter for nested elements via elasticsearch

Closes #33 (closed)

With this MR I can run filters like:


import requests

url = "http://localhost:5000/rdm/svm-api/v1/devices"

# not all, but according to pagination
all_devices = requests.get(url, headers={"accept": "application/vnd.api+json"}).json()

# again pagination; but the filtering works!
just_my_devices = requests.get(url, {"filter[contacts.email]": "nils.brinckmann@gfz-potsdam.de"}, headers={"accept": "application/vnd.api+json"}).json()

(I inserted a device in the database that I associated with my contact, and another one without. Then I also run the python3 manage.py es reindex command to make sure that I have the data in the elaticsearch - also as !213 (merged) is not merged yet).

Merge request reports

Loading