File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
client/src/api/projects/search Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -53,15 +53,17 @@ export async function searchProjects({
5353 } ,
5454 } ;
5555 const structureFilter = filters ?. find ( ( f ) => f ?. terms ?. [ "participants.structure.id.keyword" ] ) ?. terms ?. [ "participants.structure.id.keyword" ] ;
56- body . query . bool . filter . bool . should = [
57- {
58- terms : { "participants.structure.institutions.structure.keyword" : structureFilter } ,
59- } ,
60- {
61- terms : { "participants.structure.id.keyword" : structureFilter } ,
62- } ,
63- ] ;
64- body . query . bool . filter . bool . minimum_should_match = 1 ;
56+ if ( structureFilter ) {
57+ body . query . bool . filter . bool . should = [
58+ {
59+ terms : { "participants.structure.institutions.structure.keyword" : structureFilter } ,
60+ } ,
61+ {
62+ terms : { "participants.structure.id.keyword" : structureFilter } ,
63+ } ,
64+ ] ;
65+ body . query . bool . filter . bool . minimum_should_match = 1 ;
66+ }
6567 if ( size ) body . size = size ;
6668 if ( cursor ) body . search_after = cursor ;
6769 if ( ! query )
You can’t perform that action at this time.
0 commit comments