When multiple license types are selected, we should use an AND expression, not OR.
@@ -44,6 +44,9 @@ def search(search_params, index, page_size, ip, page=1) -> Response:
license_filters = []
for _license in search_params.data[license_field].split(','):
license_filters.append(Q('term', license__keyword=_license))
+ if license_field == 'lt':
+ s = s.filter('bool', must=license_filters, minimum_should_match=1)
+ else:
s = s.filter('bool', should=license_filters, minimum_should_match=1)
if 'provider' in search_params.data:
provider_filters = []
