From: <mb...@re...> - 2005-02-02 14:24:08
|
Author: mbooth Date: 2005-02-02 15:23:39 +0100 (Wed, 02 Feb 2005) New Revision: 191 Modified: ccm-cms/trunk/src/com/arsdigita/cms/search/IntermediaQueryEngine.java Log: Fix launch_date related bug introduced when I changed from using cms_pages to using cms_items. Now outer join against cms_pages. Modified: ccm-cms/trunk/src/com/arsdigita/cms/search/IntermediaQueryEngine.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/search/IntermediaQueryEngine.java 2005-01-28 22:01:59 UTC (rev 190) +++ ccm-cms/trunk/src/com/arsdigita/cms/search/IntermediaQueryEngine.java 2005-02-02 14:23:39 UTC (rev 191) @@ -47,13 +47,20 @@ public IntermediaQueryEngine() { addColumn("i.version", "version"); - //addColumn("p.launch_date", "launch_date"); + addColumn("p.launch_date", "launch_date"); addColumn("audited.last_modified", "last_modified"); addColumn("audited.modifying_user", "modifying_user"); addColumn("audited.creation_date", "creation_date"); addColumn("audited.creation_user", "creation_user"); addTable("cms_items", "i"); - //addTable("cms_pages", "p"); + + // XXX: I am going to hell for the line below. I console myself only + // because this is a hack to work around a terrible interface. + // This line replaces the existing hash entry for 'search_content' and + // abuses the alias to add a left outer join. + // mb...@re... 02/02/2005 + addTable( "search_content", "c left outer join cms_pages p on ( p.item_id = c.object_id )" ); + addTable("acs_auditing", "audited"); addCondition("c.object_id = i.item_id"); //addCondition("c.object_id = p.item_id"); @@ -71,9 +78,9 @@ } else if (VersionFilterType.KEY.equals(type.getKey())) { addVersionFilter(query, (VersionFilterSpecification)filter); } else if (LaunchDateFilterType.KEY.equals(type.getKey())) { - addColumn("p.launch_date", "launch_date"); - addTable("cms_pages", "p"); - addCondition("c.object_id = p.item_id"); + //addColumn("p.launch_date", "launch_date"); + //addTable("cms_pages", "p"); + //addCondition("c.object_id = p.item_id"); addLaunchDateFilter(query, (DateRangeFilterSpecification)filter); } else if (LastModifiedDateFilterType.KEY.equals(type.getKey())) { addLastModifiedDateFilter(query, (DateRangeFilterSpecification)filter); |