IndexedSearch migration
This commit is contained in:
parent
4f1524bd00
commit
ccc36a78de
5 changed files with 51 additions and 27 deletions
|
|
@ -94,6 +94,37 @@ sub getIcon {
|
|||
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 {
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ sub getIndexerParams {
|
|||
and asset.startDate < $now
|
||||
and asset.endDate > $now",
|
||||
fieldsToIndex => ["label", "subtext", "possibleValues"],
|
||||
contentType => 'assetDetail',
|
||||
contentType => 'content',
|
||||
url => 'WebGUI::URL::gateway($data{url})',
|
||||
headerShortcut => 'select label from DataForm_field where DataForm_fieldId = \'$data{fid}\'',
|
||||
bodyShortcut => 'select subtext, possibleValues from DataForm_field where DataForm_fieldId = \'$data{fid}\'',
|
||||
|
|
|
|||
|
|
@ -242,36 +242,29 @@ sub getIndexerParams {
|
|||
my $self = shift;
|
||||
my $now = shift;
|
||||
return {
|
||||
Poll => {
|
||||
sql => "select Poll.wobjectId as wid,
|
||||
Poll.question as question,
|
||||
Poll => {
|
||||
sql => "select Poll.assetId,
|
||||
Poll.question,
|
||||
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.a11 as a11, Poll.a12 as a12, Poll.a13 as a13, Poll.a14 as a14, Poll.a15 as a15,
|
||||
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.a16 as a16, Poll.a17 as a17, Poll.a18 as a18, Poll.a19 as a19, Poll.a20 as a20,
|
||||
wobject.namespace as namespace,
|
||||
wobject.addedBy as ownerId,
|
||||
page.urlizedTitle as urlizedTitle,
|
||||
page.languageId as languageId,
|
||||
page.pageId as pageId,
|
||||
page.groupIdView as page_groupIdView,
|
||||
wobject.groupIdView as wobject_groupIdView,
|
||||
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",
|
||||
asset.ownerUserId as ownerId,
|
||||
asset.url,
|
||||
asset.groupIdView
|
||||
from Poll, asset
|
||||
where Poll.assetId = asset.assetId
|
||||
and asset.startDate < $now
|
||||
and asset.endDate > $now",
|
||||
fieldsToIndex => ["question", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a10",
|
||||
"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}\'',
|
||||
contentType => 'assetDetail',
|
||||
url => 'WebGUI::URL::gateway($data{url})',
|
||||
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
|
||||
from Poll where wobjectId = \'$data{wid}\'',
|
||||
from Poll where assetId = \'$data{assetId}\'',
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ sub getIndexerParams {
|
|||
and asset.endDate > $now",
|
||||
fieldsToIndex => ["image1", "image2", "image3", "brochure", "manual", "warranty", "price",
|
||||
"productNumber", "benefit", "feature", "name", "value", "units"],
|
||||
contentType => 'assetDetail',
|
||||
contentType => 'content',
|
||||
url => 'WebGUI::URL::gateway($data{url})',
|
||||
headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'',
|
||||
bodyShortcut => 'select synopsis from asset where assetId = \'$data{asssetId}\'',
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ sub getIndexerParams {
|
|||
and asset.endDate > $now",
|
||||
fieldsToIndex => ["question",
|
||||
'select answer from Survey_answer where Survey_questionId = \'$data{Survey_questionId}\'' ],
|
||||
contentType => 'assetDetail',
|
||||
contentType => 'content',
|
||||
url => 'WebGUI::URL::gateway($data{url})',
|
||||
headerShortcut => 'select title from asset where assetId = \'$data{assetId}\'',
|
||||
bodyShortcut => '$textToIndex'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue