From f34dc2c8f08ecc9676a32c24c3be037bc8a9e5b6 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 24 Jul 2009 18:15:18 +0000 Subject: [PATCH] Add Story fields to the search index. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Story.pm | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 5cf2184f6..1230fb3a2 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,6 +1,7 @@ 7.7.17 - fixed #10654: Story Archive: Search not working properly - fixed search indexer concatenates keywords to content. + - fixed Index Story fields for Search (headline, subtitle, location, byline, highlights, story) 7.7.16 - fixed #10590: Session::DateTime->secondsToInterval doesn't allow 7 weeks diff --git a/lib/WebGUI/Asset/Story.pm b/lib/WebGUI/Asset/Story.pm index 49cf0ab4b..56314536d 100644 --- a/lib/WebGUI/Asset/Story.pm +++ b/lib/WebGUI/Asset/Story.pm @@ -570,6 +570,20 @@ sub getRssData { #------------------------------------------------------------------- +=head2 indexContent ( ) + +Extend the base class to index Story properties like headline, byline, etc. + +=cut + +sub indexContent { + my $self = shift; + my $indexer = $self->next::method(); + $indexer->addKeywords($self->get('headline'), $self->get('subtitle'), $self->get('location'), $self->get('highlights'), $self->get('byline'), $self->get('story'), ); +} + +#------------------------------------------------------------------- + =head2 prepareView ( ) Extent the default method to handle the case when a Story Topic is rendering