diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.sql b/docs/upgrades/upgrade_5.9.9-6.0.0.sql
index 158e66315..9d88a294b 100644
--- a/docs/upgrades/upgrade_5.9.9-6.0.0.sql
+++ b/docs/upgrades/upgrade_5.9.9-6.0.0.sql
@@ -665,7 +665,7 @@ delete from international where internationalId=365 and namespace='WebGUI';
delete from international where internationalId=366 and namespace='WebGUI';
delete from international where internationalId=910 and namespace='WebGUI';
delete from international where internationalId=912 and namespace='WebGUI';
-
+alter table IndexedSearch_docInfo add column dateIndexed int not null;
INSERT INTO template VALUES (14,'Job Listing','\n
\n\n\n\n \n\n\n\n \n\n\n
\n\n\n\n\n\n\n\n
\n\n\n\n\n| \n \"> \n | \n | \n | \n | \n
\n\n\n\n
\n\n\n \n\n','USS');
INSERT INTO template VALUES (2,'Job','
\n\n\n\nJob Description
\n\n
\n\n\n\n\nJob Requirements
\n\n
\n\n\n\n\n \n | \n
\n\n \n | \n
\n\n \n | \n
\n\n \n | \n
\n
\n\n\n\n \">« Previous Job ·\n\n\">List All Jobs\n\n · \">Next Job »\n\n
\n\n\n\n\n \">Edit\n ·\n \">\n
\n\n\n\n \nStatus: ||\n \">\n ·\n \">\n
\n\n\n\n\n','USS/Submission');
diff --git a/lib/WebGUI/Wobject/IndexedSearch.pm b/lib/WebGUI/Wobject/IndexedSearch.pm
index 8734a8569..03dd3d42e 100644
--- a/lib/WebGUI/Wobject/IndexedSearch.pm
+++ b/lib/WebGUI/Wobject/IndexedSearch.pm
@@ -116,12 +116,17 @@ sub www_edit {
}
# Index to use
- $properties->radioList( -name=>'indexName',
- -options=>\%indexName,
- -label=>WebGUI::International::get(5,$self->get("namespace")),
- -value=>$self->getValue("indexName"),
- -vertical=>1
- );
+# $properties->radioList( -name=>'indexName',
+# -options=>\%indexName,
+# -label=>WebGUI::International::get(5,$self->get("namespace")),
+# -value=>$self->getValue("indexName"),
+# -vertical=>1
+# );
+ # NOTE: For now we're limiting each site to one index. Will allow more in the future.
+ $properties->hidden(
+ -name=>"indexName",
+ -value=>"IndexedSearch_default"
+ );
# Page roots
%searchRoot = ( 'any'=>WebGUI::International::get(15,$self->get("namespace")),
diff --git a/lib/WebGUI/Wobject/IndexedSearch/Search.pm b/lib/WebGUI/Wobject/IndexedSearch/Search.pm
index 89591a823..3dc6a2f13 100644
--- a/lib/WebGUI/Wobject/IndexedSearch/Search.pm
+++ b/lib/WebGUI/Wobject/IndexedSearch/Search.pm
@@ -16,6 +16,7 @@ package WebGUI::Wobject::IndexedSearch::Search;
use strict;
use DBIx::FullTextSearch;
+use WebGUI::DateTime;
use WebGUI::SQL;
use WebGUI::URL;
use WebGUI::HTML;
@@ -436,7 +437,8 @@ sub indexDocument {
headerShortcut,
bodyShortcut,
contentType,
- ownerId )
+ ownerId,
+ dateIndexed )
values ( ".
($document->{docId} || $self->{_docId}).", ".
quote($self->getIndexName).", ".
@@ -451,7 +453,8 @@ sub indexDocument {
quote($document->{headerShortcut})." ,".
quote($document->{bodyShortcut})." ,".
quote($document->{contentType})." ,".
- ($document->{ownerId} || 3)." )"
+ ($document->{ownerId} || 3).",
+ ".WebGUI::DateTime::time()." )"
);
$self->{_docId}++;
}
diff --git a/sbin/Hourly/IndexedSearch_buildIndex.pm b/sbin/Hourly/IndexedSearch_buildIndex.pm
index 29a824194..752c4f344 100644
--- a/sbin/Hourly/IndexedSearch_buildIndex.pm
+++ b/sbin/Hourly/IndexedSearch_buildIndex.pm
@@ -23,8 +23,13 @@ use WebGUI::Wobject::IndexedSearch::Search;
#-------------------------------------------------------------------
sub process {
my $verbose = shift;
- print "\n";
my $indexName = 'IndexedSearch_default';
+ my ($dateIndexed) = WebGUI::SQL->quickArray("select max(dateIndexed) from IndexedSearch_docInfo where indexName = ".quote($indexName));
+ if (WebGUI::DateTime::time()-$dateIndexed < 86400) {
+ print " - Recently Indexed: Skipping " if ($verbose);
+ return "";
+ }
+ print "\n";
my $htmlFilter = 'all';
my $stopList = 'none';
undef $stopList if ($stopList eq 'none');