Skip to content

Commit f8194fd

Browse files
thecrypticacereinink
authored andcommitted
Hide Components from old search results from Tailwind UI
1 parent 4d0b3c1 commit f8194fd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/search.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export function SearchProvider({ children }: React.PropsWithChildren) {
120120
initialQuery={initialQuery}
121121
initialScrollY={window.scrollY}
122122
searchParameters={{
123-
facetFilters: "version:v4",
123+
facetFilters: [["version:v4", "version:plus"]],
124124
distinct: 1,
125125
attributesToRetrieve: [
126126
"hierarchy.lvl0",
@@ -161,6 +161,15 @@ export function SearchProvider({ children }: React.PropsWithChildren) {
161161
return item
162162
})
163163

164+
items = items.filter((item) => {
165+
// Remove old prev-Tailwind plus search results
166+
if (item.hierarchy?.lvl0 === "Components") {
167+
return false
168+
}
169+
170+
return true
171+
})
172+
164173
return items.map((item, index) => {
165174
// We transform the absolute URL into a relative URL to
166175
// leverage Next's preloading.

0 commit comments

Comments
 (0)