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) => {
|
||||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue