DEV: Get headline excerpt config from GroupedSearchResult in serializer. (#20942)

Follow-up to #20939
This commit is contained in:
Roman Rizzi 2023-04-03 15:02:42 -03:00 committed by GitHub
parent 29e2e3ff3b
commit cbc5b2febc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,9 @@ class SearchPostSerializer < BasicPostSerializer
attributes :like_count, :blurb, :post_number, :topic_title_headline
def include_topic_title_headline?
if SiteSetting.use_pg_headlines_for_excerpt
if options[:result]
options[:result].use_pg_headlines_for_excerpt
elsif SiteSetting.use_pg_headlines_for_excerpt
object.topic_title_headline.present?
else
false