Skip to content

Commit

Permalink
Fix date range search indexing.
Browse files Browse the repository at this point in the history
There are two dates, so the regex needs to replace both.
  • Loading branch information
dracos committed Feb 25, 2014
1 parent ca898e9 commit 7166f44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions search/index.pl
Expand Up @@ -101,7 +101,7 @@
from epobject join hansard on epobject.epobject_id = hansard.epobject_id
left join member on hansard.speaker_id = member.member_id
left join epobject as section on hansard.section_id = section.epobject_id";
(my $sdc = $since_date_condition) =~ s/{{date}}/hdate/;
(my $sdc = $since_date_condition) =~ s/{{date}}/hdate/g;
$sdc =~ s/{{modified}}/hansard.modified/;
$query .= $sdc;
$query .= ' and major = ' . $section if ($section);
Expand Down Expand Up @@ -203,7 +203,7 @@

# Now add Future Business to the index.
my $fb_query = "SELECT id, body, chamber, event_date, committee_name, debate_type, title, witnesses, location, deleted, pos, unix_timestamp(modified) as modified FROM future";
($sdc = $since_date_condition) =~ s/{{date}}/event_date/;
($sdc = $since_date_condition) =~ s/{{date}}/event_date/g;
$sdc =~ s/{{modified}}/modified/;
$fb_query .= $sdc;

Expand Down

0 comments on commit 7166f44

Please sign in to comment.