From 6402c8f3af836c8d00007f8c0232829cea4d914b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 13 Sep 2004 19:44:38 +0000 Subject: [PATCH] fixed search indexer errors --- docs/changelog/6.x.x.txt | 2 ++ lib/WebGUI/Wobject/EventsCalendar.pm | 4 ++-- lib/WebGUI/Wobject/FileManager.pm | 4 ++-- lib/WebGUI/Wobject/IndexedSearch.pm | 2 +- lib/WebGUI/Wobject/IndexedSearch/Search.pm | 2 +- lib/WebGUI/Wobject/MessageBoard.pm | 8 ++++---- lib/WebGUI/Wobject/Poll.pm | 4 ++-- lib/WebGUI/Wobject/Product.pm | 4 ++-- lib/WebGUI/Wobject/Survey.pm | 6 +++--- lib/WebGUI/Wobject/USS.pm | 8 ++++---- 10 files changed, 23 insertions(+), 21 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 2c57b8343..63db87fb5 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -22,6 +22,8 @@ - bugfix [ 1027129 ] view message causes error - bugfix [ 1024079 ] "Software error" message - Fixed a bunch of POD errors. + - Fixed some errors in the search engine indexer related to the new GUID + system. 6.2.1 diff --git a/lib/WebGUI/Wobject/EventsCalendar.pm b/lib/WebGUI/Wobject/EventsCalendar.pm index 4757650cd..9ba548de0 100644 --- a/lib/WebGUI/Wobject/EventsCalendar.pm +++ b/lib/WebGUI/Wobject/EventsCalendar.pm @@ -76,8 +76,8 @@ sub getIndexerParams { fieldsToIndex => ["description", "name"], contentType => 'wobjectDetail', url => 'WebGUI::URL::append($data{urlizedTitle},"func=viewEvent&wid=$data{wid}&eid=$data{eid}")', - headerShortcut => 'select name from EventsCalendar_event where EventsCalendar_eventId=$data{eid}', - bodyShortcut => 'select description from EventsCalendar_event where EventsCalendar_eventId=$data{eid}', + headerShortcut => 'select name from EventsCalendar_event where EventsCalendar_eventId=\'$data{eid}\'', + bodyShortcut => 'select description from EventsCalendar_event where EventsCalendar_eventId=\'$data{eid}\'', } }; } diff --git a/lib/WebGUI/Wobject/FileManager.pm b/lib/WebGUI/Wobject/FileManager.pm index 9e7729f61..6aa1edcab 100644 --- a/lib/WebGUI/Wobject/FileManager.pm +++ b/lib/WebGUI/Wobject/FileManager.pm @@ -93,8 +93,8 @@ sub getIndexerParams { fieldsToIndex => ["fileTitle", "downloadFile", "briefSynopsis", "alternateVersion1", "alternateVersion2"], contentType => 'wobjectDetail', url => '$data{urlizedTitle}."#".$data{wid}', - headerShortcut => 'select fileTitle from FileManager_file where FileManager_fileId = $data{fid}', - bodyShortcut => 'select briefSynopsis from FileManager_file where FileManager_fileId = $data{fid}', + headerShortcut => 'select fileTitle from FileManager_file where FileManager_fileId = \'$data{fid}\'', + bodyShortcut => 'select briefSynopsis from FileManager_file where FileManager_fileId = \'$data{fid}\'', } }; } diff --git a/lib/WebGUI/Wobject/IndexedSearch.pm b/lib/WebGUI/Wobject/IndexedSearch.pm index 4508432f4..a5028f7e2 100644 --- a/lib/WebGUI/Wobject/IndexedSearch.pm +++ b/lib/WebGUI/Wobject/IndexedSearch.pm @@ -133,7 +133,7 @@ sub www_edit { # Page roots %searchRoot = ( 'any'=>WebGUI::International::get(15,$self->get("namespace")), $session{page}{pageId}=>WebGUI::International::get(4,$self->get("namespace")), - WebGUI::SQL->buildHash("select pageId,title from page where parentId=0 and (pageId=1 or pageId>999) order by title") + WebGUI::SQL->buildHash("select pageId,title from page where parentId=0 and isSystem<>1 order by title") ); $properties->checkList ( -name=>'searchRoot', -options=>\%searchRoot, diff --git a/lib/WebGUI/Wobject/IndexedSearch/Search.pm b/lib/WebGUI/Wobject/IndexedSearch/Search.pm index 1a7ee4c5b..5a66ddc29 100644 --- a/lib/WebGUI/Wobject/IndexedSearch/Search.pm +++ b/lib/WebGUI/Wobject/IndexedSearch/Search.pm @@ -669,7 +669,7 @@ sub search { $sql .= " AND $filterElement in (".quoteAndJoin($filter->{$filterElement}).")"; } # No trash or other garbage - $sql .= " AND (pageId > 999 or pageId < 0 or pageId = 1) "; + $sql .= " AND isSystem<>1 "; # Keep @fts_docIds list order $sql .= " ORDER BY FIELD(docID,$docIds)" unless $noFtsSearch; my $filteredDocIds = WebGUI::SQL->buildArrayRef($sql); diff --git a/lib/WebGUI/Wobject/MessageBoard.pm b/lib/WebGUI/Wobject/MessageBoard.pm index d8750b717..3d13c673e 100644 --- a/lib/WebGUI/Wobject/MessageBoard.pm +++ b/lib/WebGUI/Wobject/MessageBoard.pm @@ -67,8 +67,8 @@ sub getIndexerParams { fieldsToIndex => ["title", "description"], contentType => 'wobject', url => '$data{urlizedTitle}."#".$data{wid}', - headerShortcut => 'select title from MessageBoard_forums where wobjectId = $data{wid}', - bodyShortcut => 'select description from MessageBoard_forums where wobjectId = $data{wid}', + headerShortcut => 'select title from MessageBoard_forums where wobjectId = \'$data{wid}\'', + bodyShortcut => 'select description from MessageBoard_forums where wobjectId = \'$data{wid}\'', }, MessageBoard_Forum => { sql => "select forumPost.forumPostId, @@ -98,8 +98,8 @@ sub getIndexerParams { fieldsToIndex => ["username", "subject", "message"], contentType => 'discussion', url => 'WebGUI::URL::append($data{urlizedTitle},"func=view&wid=$data{wid}&forumOp=viewThread&forumPostId=$data{forumPostId}&forumId=$data{forumId}")', - headerShortcut => 'select subject from forumPost where forumPostId = $data{forumPostId}', - bodyShortcut => 'select message from forumPost where forumPostId = $data{forumPostId}', + headerShortcut => 'select subject from forumPost where forumPostId = \'$data{forumPostId}\'', + bodyShortcut => 'select message from forumPost where forumPostId = \'$data{forumPostId}\'', } }; } diff --git a/lib/WebGUI/Wobject/Poll.pm b/lib/WebGUI/Wobject/Poll.pm index 0c7cd2b9c..b577313d7 100644 --- a/lib/WebGUI/Wobject/Poll.pm +++ b/lib/WebGUI/Wobject/Poll.pm @@ -78,9 +78,9 @@ sub getIndexerParams { "a11", "a12", "a13", "a14", "a15", "a16", "a17", "a18", "a19", "a20"], contentType => 'wobjectDetail', url => 'WebGUI::URL::append($data{urlizedTitle}, "func=view&wid=$data{wid}")', - headerShortcut => 'select question from Poll where wobjectId = $data{wid}', + headerShortcut => 'select question from Poll where wobjectId = \'$data{wid}\'', bodyShortcut => 'select a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20 - from Poll where wobjectId = $data{wid}', + from Poll where wobjectId = \'$data{wid}\'', } }; } diff --git a/lib/WebGUI/Wobject/Product.pm b/lib/WebGUI/Wobject/Product.pm index b876a6cb9..b61d56c38 100644 --- a/lib/WebGUI/Wobject/Product.pm +++ b/lib/WebGUI/Wobject/Product.pm @@ -116,8 +116,8 @@ sub getIndexerParams { "productNumber", "benefit", "feature", "name", "value", "units"], contentType => 'wobjectDetail', url => 'WebGUI::URL::append($data{urlizedTitle}, "func=view&wid=$data{wid}")', - headerShortcut => 'select title from wobject where wobjectId = $data{wid}', - bodyShortcut => 'select description from wobject where wobjectId = $data{wid}', + headerShortcut => 'select title from wobject where wobjectId = \'$data{wid}\'', + bodyShortcut => 'select description from wobject where wobjectId = \'$data{wid}\'', } }; } diff --git a/lib/WebGUI/Wobject/Survey.pm b/lib/WebGUI/Wobject/Survey.pm index 7ae802ce7..aec2f017e 100644 --- a/lib/WebGUI/Wobject/Survey.pm +++ b/lib/WebGUI/Wobject/Survey.pm @@ -137,11 +137,11 @@ sub getIndexerParams { and page.startDate < $now and page.endDate > $now", fieldsToIndex => ["question", - 'select answer from Survey_answer where Survey_questionId = $data{Survey_questionId}' ], + 'select answer from Survey_answer where Survey_questionId = \'$data{Survey_questionId}\'' ], contentType => 'wobjectDetail', url => 'WebGUI::URL::append($data{urlizedTitle}, "func=view&wid=$data{wid}")', - headerShortcut => 'select title from wobject where wobjectId = $data{wid}', - bodyShortcut => 'select description from wobject where wobjectId = $data{wid}', + headerShortcut => 'select title from wobject where wobjectId = \'$data{wid}\'', + bodyShortcut => 'select description from wobject where wobjectId = \'$data{wid}\'', } }; diff --git a/lib/WebGUI/Wobject/USS.pm b/lib/WebGUI/Wobject/USS.pm index 928baf35d..028f90f62 100644 --- a/lib/WebGUI/Wobject/USS.pm +++ b/lib/WebGUI/Wobject/USS.pm @@ -114,8 +114,8 @@ sub getIndexerParams { fieldsToIndex => ["username", "subject", "message"], contentType => 'discussion', url => 'WebGUI::URL::append($data{urlizedTitle},"func=viewSubmission&wid=$data{wid}&sid=$data{sid}&forumOp=viewThread&forumPostId=$data{forumPostId}&forumId=$data{forumId}")', - headerShortcut => 'select subject from forumPost where forumPostId = $data{forumPostId}', - bodyShortcut => 'select message from forumPost where forumPostId = $data{forumPostId}', + headerShortcut => 'select subject from forumPost where forumPostId = \'$data{forumPostId}\'', + bodyShortcut => 'select message from forumPost where forumPostId = \'$data{forumPostId}\'', }, USS_submission => { sql => "select USS_submission.title as title, @@ -145,8 +145,8 @@ sub getIndexerParams { fieldsToIndex => ["username", "title", "content", "image", "attachment"], contentType => 'wobjectDetail', url => 'WebGUI::URL::append($data{urlizedTitle}, "func=viewSubmission&wid=$data{wid}&sid=$data{sid}")', - headerShortcut => 'select title from USS_submission where USS_submissionId = $data{sid}', - bodyShortcut => 'select content from USS_submission where USS_submissionId = $data{sid}', + headerShortcut => 'select title from USS_submission where USS_submissionId = \'$data{sid}\'', + bodyShortcut => 'select content from USS_submission where USS_submissionId = \'$data{sid}\'', } }; }