fixed filetype modified for media types in text search

pull/1/head
Michael Peter Christen 13 years ago
parent 97f82994a6
commit 619bf7e875

@ -135,12 +135,12 @@ public class Classification {
return appsExtSet.contains(appsExt.trim().toLowerCase()); return appsExtSet.contains(appsExt.trim().toLowerCase());
} }
public static boolean isControlExtension(final String ctrlExt) { private static boolean isControlExtension(final String ctrlExt) {
if (ctrlExt == null) return false; if (ctrlExt == null) return false;
return ctrlExtSet.contains(ctrlExt.trim().toLowerCase()); return ctrlExtSet.contains(ctrlExt.trim().toLowerCase());
} }
public static ContentDomain getContentDomain(final String ext) { protected static ContentDomain getContentDomain(final String ext) {
if (isTextExtension(ext)) return ContentDomain.TEXT; if (isTextExtension(ext)) return ContentDomain.TEXT;
if (isImageExtension(ext)) return ContentDomain.IMAGE; if (isImageExtension(ext)) return ContentDomain.IMAGE;
if (isAudioExtension(ext)) return ContentDomain.AUDIO; if (isAudioExtension(ext)) return ContentDomain.AUDIO;

@ -502,7 +502,14 @@ public final class SearchEvent {
final boolean httpPattern = pattern.equals("http://.*"); final boolean httpPattern = pattern.equals("http://.*");
final boolean noHttpButProtocolPattern = pattern.equals("https://.*") || pattern.equals("ftp://.*") || pattern.equals("smb://.*") || pattern.equals("file://.*"); final boolean noHttpButProtocolPattern = pattern.equals("https://.*") || pattern.equals("ftp://.*") || pattern.equals("smb://.*") || pattern.equals("file://.*");
pollloop: for (URIMetadataNode iEntry: index) { pollloop: for (URIMetadataNode iEntry: index) {
if ( !this.query.urlMask_isCatchall ) {
// check url mask
if (!iEntry.matches(this.query.urlMask)) {
continue pollloop;
}
}
// doublecheck for urls // doublecheck for urls
if (this.rankingProcess.urlhashes.has(iEntry.hash())) { if (this.rankingProcess.urlhashes.has(iEntry.hash())) {
continue pollloop; continue pollloop;
@ -770,8 +777,8 @@ public final class SearchEvent {
} }
// check content domain // check content domain
if ((this.query.contentdom.getCode() > 0 && page.url().getContentDomain() != this.query.contentdom) || if (((this.query.contentdom.getCode() > 0 && page.url().getContentDomain() != this.query.contentdom) ||
(this.query.contentdom == Classification.ContentDomain.TEXT && page.url().getContentDomain().getCode() > 0)) { (this.query.contentdom == Classification.ContentDomain.TEXT && page.url().getContentDomain().getCode() > 0)) && this.query.urlMask_isCatchall) {
this.query.misses.add(page.hash()); this.query.misses.add(page.hash());
continue; continue;
} }

@ -45,7 +45,7 @@ public class SnippetWorker extends Thread {
private final int neededResults; private final int neededResults;
private boolean shallrun; private boolean shallrun;
public SnippetWorker(final SearchEvent snippetProcess, final long maxlifetime, final CacheStrategy cacheStrategy, final int neededResults) { protected SnippetWorker(final SearchEvent snippetProcess, final long maxlifetime, final CacheStrategy cacheStrategy, final int neededResults) {
this.snippetProcess = snippetProcess; this.snippetProcess = snippetProcess;
this.cacheStrategy = cacheStrategy; this.cacheStrategy = cacheStrategy;
this.lastLifeSign = System.currentTimeMillis(); this.lastLifeSign = System.currentTimeMillis();

Loading…
Cancel
Save