0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Extended search results to use real author and tags data

refs https://github.com/TryGhost/Team/issues/1665

- matches real author and tag data from search index to show results
This commit is contained in:
Rishabh 2022-07-06 12:28:36 +02:00
parent f1fbe1bf9a
commit 99f654192f

View file

@ -182,8 +182,8 @@ function TagResults({tags}) {
const TagItems = tags.map((d) => {
return (
<TagListItem
key={d.title}
title={d.title}
key={d.name}
title={d.name}
/>
);
});
@ -293,14 +293,9 @@ function SearchResultBox() {
if (indexComplete && searchValue) {
searchResults = searchIndex.search(searchValue);
filteredPosts = searchResults?.posts?.map((d) => {
return {
id: d?.id,
excerpt: d?.excerpt,
title: d?.title,
slug: d?.slug
};
}) || [];
filteredPosts = searchResults?.posts || [];
filteredAuthors = searchResults?.authors || [];
filteredTags = searchResults?.tags || [];
}
const hasResults = filteredPosts?.length || filteredAuthors?.length || filteredTags?.length;