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:
parent
f1fbe1bf9a
commit
99f654192f
1 changed files with 5 additions and 10 deletions
|
@ -182,8 +182,8 @@ function TagResults({tags}) {
|
||||||
const TagItems = tags.map((d) => {
|
const TagItems = tags.map((d) => {
|
||||||
return (
|
return (
|
||||||
<TagListItem
|
<TagListItem
|
||||||
key={d.title}
|
key={d.name}
|
||||||
title={d.title}
|
title={d.name}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -293,14 +293,9 @@ function SearchResultBox() {
|
||||||
|
|
||||||
if (indexComplete && searchValue) {
|
if (indexComplete && searchValue) {
|
||||||
searchResults = searchIndex.search(searchValue);
|
searchResults = searchIndex.search(searchValue);
|
||||||
filteredPosts = searchResults?.posts?.map((d) => {
|
filteredPosts = searchResults?.posts || [];
|
||||||
return {
|
filteredAuthors = searchResults?.authors || [];
|
||||||
id: d?.id,
|
filteredTags = searchResults?.tags || [];
|
||||||
excerpt: d?.excerpt,
|
|
||||||
title: d?.title,
|
|
||||||
slug: d?.slug
|
|
||||||
};
|
|
||||||
}) || [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasResults = filteredPosts?.length || filteredAuthors?.length || filteredTags?.length;
|
const hasResults = filteredPosts?.length || filteredAuthors?.length || filteredTags?.length;
|
||||||
|
|
Loading…
Add table
Reference in a new issue