Skip to content

Commit

Permalink
fixing case insensitive for filtering terms
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Nov 22, 2024
1 parent eaabfcf commit a5225bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion beacon/connections/mongo/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def apply_ontology_filter(self, query: dict, filter: OntologyFilter, collection:
dict_regex={}
try:
dict_regex['$regex']=label
dict_regex['$options']='i'
except Exception:
dict_regex['$regex']=''
dict_id={}
Expand Down Expand Up @@ -668,6 +669,7 @@ def apply_ontology_filter(self, query: dict, filter: OntologyFilter, collection:
dict_regex={}
try:
dict_regex['$regex']=label
dict_regex['$options']='i'
except Exception:# pragma: no cover
dict_regex['$regex']=''
dict_id={}
Expand Down Expand Up @@ -696,7 +698,6 @@ def apply_ontology_filter(self, query: dict, filter: OntologyFilter, collection:
query_id[query_term]=simil
new_query['$or'].append(query_id)
query = new_query

query=cross_query(self, query, scope, collection, request_parameters, dataset)


Expand All @@ -723,6 +724,7 @@ def apply_ontology_filter(self, query: dict, filter: OntologyFilter, collection:
query_filtering['$and'].append(dict_scope)
dict_regex={}
dict_regex['$regex']=label
dict_regex['$options']='i'
dict_id={}
dict_id['id']=dict_regex
query_filtering['$and'].append(dict_id)
Expand Down Expand Up @@ -1000,6 +1002,7 @@ def apply_alphanumeric_filter(self, query: dict, filter: AlphanumericFilter, col
dict_id={}
dict_regex={}
dict_regex['$regex']=filter.id
dict_regex['$options']='i'
dict_type['type']='custom'
dict_id['id']=dict_regex
query_filtering['$and'].append(dict_type)
Expand Down

0 comments on commit a5225bd

Please sign in to comment.