Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-766: small improvement to Tika parser : prioritise default Tika parser when discovering plugins matching mime-type

Julien Niochec654817378a6
diff --git a/src/java/org/apache/nutch/parse/ParserFactory.java b/src/java/org/apache/nutch/parse/ParserFactory.java
index cce86aebc..fc9ef7090 100644
--- a/src/java/org/apache/nutch/parse/ParserFactory.java
+++ b/src/java/org/apache/nutch/parse/ParserFactory.java
@@ -343,11 +343,14 @@ public final class ParserFactory {
// NotMappedParserException
for (int i=0; i<extensions.length; i++) {
- if ((extensions[i].getAttribute("contentType") != null
+ if (extensions[i].getAttribute("contentType") != null
&& extensions[i].getAttribute("contentType").equals(
- contentType)) || "*".equals(extensions[i].getAttribute("contentType") )) {
+ contentType)) {
extList.add(extensions[i]);
}
+ else if ("*".equals(extensions[i].getAttribute("contentType"))){
+ extList.add(0, extensions[i]);
+ }
}
if (extList.size() > 0) {