diff --git a/frontend/src/components/SearchBox.tsx b/frontend/src/components/SearchBox.tsx index f0222c67b..47ff7eefe 100644 --- a/frontend/src/components/SearchBox.tsx +++ b/frontend/src/components/SearchBox.tsx @@ -160,6 +160,7 @@ export default function SearchBox({ let autocompleteElements = autocompleteToShow.map( (autocomplete, i): SearchBoxEntry => { searchParams.set("q", autocomplete.autosuggest); + if (ontologyId) searchParams.set("ontology", ontologyId); const linkUrl = `/search?${new URLSearchParams(searchParams)}`; return { linkUrl, @@ -329,6 +330,7 @@ export default function SearchBox({ navigate(allDropdownElements[arrowKeySelectedN].linkUrl); } else if (query) { searchParams.set("q", query); + if (ontologyId) searchParams.set("ontology", ontologyId); navigate(`/search?${new URLSearchParams(searchParams)}`); } } else if (ev.key === "ArrowDown") { @@ -382,6 +384,8 @@ export default function SearchBox({ onClick={() => { if (query) { searchParams.set("q", query); + if (ontologyId) + searchParams.set("ontology", ontologyId); navigate(`/search?${new URLSearchParams(searchParams)}`); } }} @@ -398,6 +402,7 @@ export default function SearchBox({ onClick={() => { if (query) { searchParams.set("q", query); + if (ontologyId) searchParams.set("ontologyId", ontologyId); navigate(`/search?${new URLSearchParams(searchParams)}`); } }}