IndexedSearch migration

This commit is contained in:
Len Kranendonk 2005-02-13 21:38:13 +00:00
parent 4f1524bd00
commit ccc36a78de
5 changed files with 51 additions and 27 deletions

View file

@ -94,6 +94,37 @@ sub getIcon {
return $session{config}{extrasURL}.'/assets/article.gif'; return $session{config}{extrasURL}.'/assets/article.gif';
} }
#-------------------------------------------------------------------
sub getIndexerParams {
my $self = shift;
my $now = shift;
return {
Article => {
sql => "select Article.assetId,
Article.linkTitle,
Article.linkURL,
asset.title,
asset.menuTitle,
asset.url,
asset.className,
asset.ownerUserId,
asset.groupIdView,
asset.synopsis,
wobject.description
from asset, Article
left join wobject on wobject.assetId = asset.assetId
where asset.assetId = Article.assetId
and asset.startDate < $now
and asset.endDate > $now",
fieldsToIndex => ["linkTitle" ,"linkURL","title","menuTitle","url","synopsis","description" ],
contentType => 'content',
url => 'WebGUI::URL::gateway($data{url})',
headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'',
bodyShortcut => 'select description from wobject where assetId = \'$data{assetId}\'',
}
};
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub getName { sub getName {

View file

@ -268,7 +268,7 @@ sub getIndexerParams {
and asset.startDate < $now and asset.startDate < $now
and asset.endDate > $now", and asset.endDate > $now",
fieldsToIndex => ["label", "subtext", "possibleValues"], fieldsToIndex => ["label", "subtext", "possibleValues"],
contentType => 'assetDetail', contentType => 'content',
url => 'WebGUI::URL::gateway($data{url})', url => 'WebGUI::URL::gateway($data{url})',
headerShortcut => 'select label from DataForm_field where DataForm_fieldId = \'$data{fid}\'', headerShortcut => 'select label from DataForm_field where DataForm_fieldId = \'$data{fid}\'',
bodyShortcut => 'select subtext, possibleValues from DataForm_field where DataForm_fieldId = \'$data{fid}\'', bodyShortcut => 'select subtext, possibleValues from DataForm_field where DataForm_fieldId = \'$data{fid}\'',

View file

@ -242,36 +242,29 @@ sub getIndexerParams {
my $self = shift; my $self = shift;
my $now = shift; my $now = shift;
return { return {
Poll => { Poll => {
sql => "select Poll.wobjectId as wid, sql => "select Poll.assetId,
Poll.question as question, Poll.question,
Poll.a1 as a1, Poll.a2 as a2, Poll.a3 as a3, Poll.a4 as a4, Poll.a5 as a5, Poll.a1 as a1, Poll.a2 as a2, Poll.a3 as a3, Poll.a4 as a4, Poll.a5 as a5,
Poll.a6 as a6, Poll.a7 as a7, Poll.a8 as a8, Poll.a9 as a9, Poll.a10 as a10, Poll.a6 as a6, Poll.a7 as a7, Poll.a8 as a8, Poll.a9 as a9, Poll.a10 as a10,
Poll.a11 as a11, Poll.a12 as a12, Poll.a13 as a13, Poll.a14 as a14, Poll.a15 as a15, Poll.a11 as a11, Poll.a12 as a12, Poll.a13 as a13, Poll.a14 as a14, Poll.a15 as a15,
Poll.a16 as a16, Poll.a17 as a17, Poll.a18 as a18, Poll.a19 as a19, Poll.a20 as a20, Poll.a16 as a16, Poll.a17 as a17, Poll.a18 as a18, Poll.a19 as a19, Poll.a20 as a20,
wobject.namespace as namespace, asset.ownerUserId as ownerId,
wobject.addedBy as ownerId, asset.url,
page.urlizedTitle as urlizedTitle, asset.groupIdView
page.languageId as languageId, from Poll, asset
page.pageId as pageId, where Poll.assetId = asset.assetId
page.groupIdView as page_groupIdView, and asset.startDate < $now
wobject.groupIdView as wobject_groupIdView, and asset.endDate > $now",
7 as wobject_special_groupIdView
from Poll, wobject, page
where Poll.wobjectId = wobject.wobjectId
and wobject.pageId = page.pageId
and wobject.startDate < $now
and wobject.endDate > $now
and page.startDate < $now
and page.endDate > $now",
fieldsToIndex => ["question", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10", fieldsToIndex => ["question", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
"a11", "a12", "a13", "a14", "a15", "a16", "a17", "a18", "a19", "a20"], "a11", "a12", "a13", "a14", "a15", "a16", "a17", "a18", "a19", "a20"],
contentType => 'wobjectDetail', contentType => 'assetDetail',
url => 'WebGUI::URL::append($data{urlizedTitle}, "func=view&wid=$data{wid}")', url => 'WebGUI::URL::gateway($data{url})',
headerShortcut => 'select question from Poll where wobjectId = \'$data{wid}\'', headerShortcut => 'select question from Poll where assetId = \'$data{assetId}\'',
bodyShortcut => 'select a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20 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 assetId = \'$data{assetId}\'',
} }
}; };
} }

View file

@ -287,7 +287,7 @@ sub getIndexerParams {
and asset.endDate > $now", and asset.endDate > $now",
fieldsToIndex => ["image1", "image2", "image3", "brochure", "manual", "warranty", "price", fieldsToIndex => ["image1", "image2", "image3", "brochure", "manual", "warranty", "price",
"productNumber", "benefit", "feature", "name", "value", "units"], "productNumber", "benefit", "feature", "name", "value", "units"],
contentType => 'assetDetail', contentType => 'content',
url => 'WebGUI::URL::gateway($data{url})', url => 'WebGUI::URL::gateway($data{url})',
headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'', headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'',
bodyShortcut => 'select synopsis from asset where assetId = \'$data{asssetId}\'', bodyShortcut => 'select synopsis from asset where assetId = \'$data{asssetId}\'',

View file

@ -305,7 +305,7 @@ sub getIndexerParams {
and asset.endDate > $now", and asset.endDate > $now",
fieldsToIndex => ["question", 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 => 'assetDetail', contentType => 'content',
url => 'WebGUI::URL::gateway($data{url})', url => 'WebGUI::URL::gateway($data{url})',
headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'', headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'',
bodyShortcut => '$textToIndex' bodyShortcut => '$textToIndex'