prevent checking of urldb if empty

- disconnect urlIndexFile if empty
- add missing lock class in submenuSearchConfiguration
pull/1/head
reger 12 years ago
parent 1fb452174a
commit 3b6e08b49f

@ -2,7 +2,7 @@
<h3>Integrated Search Configuration</h3>
<ul class="SubMenu">
<li><a href="/ConfigPortal.html" class="MenuItemLink">Generic Search Portal</a></li>
<li><a href="/ConfigSearchPage_p.html" class="MenuItemLink">Search Page Layout</a></li>
<li><a href="/ConfigSearchPage_p.html" class="MenuItemLink lock">Search Page Layout</a></li>
<li><a href="/ConfigAppearance_p.html" class="MenuItemLink lock">Appearance</a></li>
<li><a href="/ConfigLanguage_p.html" class="MenuItemLink lock">Language</a></li>
<li><a href="/ConfigProfile_p.html" class="MenuItemLink lock">User Profile</a></li>

@ -104,6 +104,12 @@ public final class Fulltext implements Iterable<byte[]> {
if (this.urlIndexFile != null) return;
this.tablename = tablename;
this.urlIndexFile = new SplitTable(this.location, tablename, URIMetadataRow.rowdef, useTailCache, exceed134217727);
// SplitTable always returns != null, even if no file exists.
// as old UrlDb should be null if not exist, check and close if empty
// TODO: check if a SplitTable.open() returning null or error status on not existing file is preferable
if (this.urlIndexFile.isEmpty()) {
disconnectUrlDb();
}
}
public void disconnectUrlDb() {
@ -193,8 +199,7 @@ public final class Fulltext implements Iterable<byte[]> {
}
public int size() {
int size = 0;
size += this.urlIndexFile == null ? 0 : this.urlIndexFile.size();
int size = this.urlIndexFile == null ? 0 : this.urlIndexFile.size();
size += this.solr.getSize();
return size;
}

Loading…
Cancel
Save