fixed filetype modified for media types in text search

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

@ -135,12 +135,12 @@ public class Classification {
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;
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 (isImageExtension(ext)) return ContentDomain.IMAGE;
if (isAudioExtension(ext)) return ContentDomain.AUDIO;

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

@ -45,7 +45,7 @@ public class SnippetWorker extends Thread {
private final int neededResults;
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.cacheStrategy = cacheStrategy;
this.lastLifeSign = System.currentTimeMillis();

Loading…
Cancel
Save