hpi-schul-cloud / schulcloud-content-editor

Schul-Cloud Content Editor
https://schul-cloud.github.io/schulcloud-content-editor
GNU Affero General Public License v3.0
5 stars 1 forks source link

filters aren't applied when searching for content #75

Closed adrianjost closed 5 years ago

adrianjost commented 6 years ago

Branch: 75-fix-filters-not-applied

adrianjost commented 6 years ago

@kremer-io Requests to https://schul-cloud.org:8080/content/search/?providerName[$in]=Youtube results in { "name": "GeneralError", "message": "400 - {\"name\":\"BadRequest\",\"message\":\"[parsing_exception] [terms] query does not support [providerName], with { line=1 & col=54 }\",\"code\":400,\"className\":\"bad-request\",\"data\":{\"msg\":\"[parsing_exception] [terms] query does not support [providerName], with { line=1 & col=54 }\",\"path\":\"/schulcloud_content/resources/_search\",\"query\":{\"_source\":\"true\",\"from\":0,\"size\":3},\"body\":\"{\\\"query\\\":{\\\"bool\\\":{\\\"filter\\\":[{\\\"terms\\\":{\\\"providerName\\\":\\\"Youtube\\\"}}]}}}\",\"statusCode\":400,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"parsing_exception\\\",\\\"reason\\\":\\\"[terms] query does not support [providerName]\\\",\\\"line\\\":1,\\\"col\\\":54}],\\\"type\\\":\\\"parsing_exception\\\",\\\"reason\\\":\\\"[terms] query does not support [providerName]\\\",\\\"line\\\":1,\\\"col\\\":54},\\\"status\\\":400}\"},\"errors\":{}}", "code": 500, "className": "general-error", "data": {}, "errors": {} }

the request should be okay if I compare it to the feathers.js docs

however the undocumented $match works fine (but we don't need it here)