sixcooler 9 years ago
commit 0431be8d6c

@ -43,8 +43,8 @@
<classpathentry kind="lib" path="lib/pdfbox-1.8.10.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-1.46.jar"/>
<classpathentry kind="lib" path="lib/poi-3.12-20150511.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.12-20150511.jar"/>
<classpathentry kind="lib" path="lib/poi-3.13-20150929.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.13-20150929.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.7.12.jar"/>
<classpathentry kind="lib" path="lib/chardet.jar"/>
@ -65,26 +65,26 @@
<classpathentry kind="lib" path="lib/httpclient-4.5.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.5.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.6.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/solr-core-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/solr-solrj-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/stax2-api-3.1.4.jar"/>
<classpathentry kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.2.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-common-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-analyzers-phonetic-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-classification-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-codecs-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-core-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-facet-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-grouping-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-highlighter-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-join-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-memory-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-misc-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queries-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-queryparser-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-spatial-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-suggest-5.3.1.jar"/>
<classpathentry kind="lib" path="lib/lucene-backward-codecs-5.3.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/icu4j-55_1.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>

@ -204,32 +204,32 @@
<pathelement location="${lib}/json-simple-1.1.1.jar" />
<pathelement location="${lib}/jsoup-1.8.3.jar" />
<pathelement location="${lib}/log4j-over-slf4j-1.7.12.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.2.1.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.2.1.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.2.1.jar" />
<pathelement location="${lib}/lucene-classification-5.2.1.jar" />
<pathelement location="${lib}/lucene-codecs-5.2.1.jar" />
<pathelement location="${lib}/lucene-core-5.2.1.jar" />
<pathelement location="${lib}/lucene-facet-5.2.1.jar" />
<pathelement location="${lib}/lucene-grouping-5.2.1.jar" />
<pathelement location="${lib}/lucene-highlighter-5.2.1.jar" />
<pathelement location="${lib}/lucene-join-5.2.1.jar" />
<pathelement location="${lib}/lucene-memory-5.2.1.jar" />
<pathelement location="${lib}/lucene-misc-5.2.1.jar" />
<pathelement location="${lib}/lucene-queries-5.2.1.jar" />
<pathelement location="${lib}/lucene-queryparser-5.2.1.jar" />
<pathelement location="${lib}/lucene-spatial-5.2.1.jar" />
<pathelement location="${lib}/lucene-suggest-5.2.1.jar" />
<pathelement location="${lib}/lucene-analyzers-common-5.3.1.jar" />
<pathelement location="${lib}/lucene-analyzers-phonetic-5.3.1.jar" />
<pathelement location="${lib}/lucene-backward-codecs-5.3.1.jar" />
<pathelement location="${lib}/lucene-classification-5.3.1.jar" />
<pathelement location="${lib}/lucene-codecs-5.3.1.jar" />
<pathelement location="${lib}/lucene-core-5.3.1.jar" />
<pathelement location="${lib}/lucene-facet-5.3.1.jar" />
<pathelement location="${lib}/lucene-grouping-5.3.1.jar" />
<pathelement location="${lib}/lucene-highlighter-5.3.1.jar" />
<pathelement location="${lib}/lucene-join-5.3.1.jar" />
<pathelement location="${lib}/lucene-memory-5.3.1.jar" />
<pathelement location="${lib}/lucene-misc-5.3.1.jar" />
<pathelement location="${lib}/lucene-queries-5.3.1.jar" />
<pathelement location="${lib}/lucene-queryparser-5.3.1.jar" />
<pathelement location="${lib}/lucene-spatial-5.3.1.jar" />
<pathelement location="${lib}/lucene-suggest-5.3.1.jar" />
<pathelement location="${lib}/metadata-extractor-2.8.1.jar" />
<pathelement location="${lib}/noggit-0.5.jar" />
<pathelement location="${lib}/org.restlet.jar" />
<pathelement location="${lib}/pdfbox-1.8.10.jar" />
<pathelement location="${lib}/poi-3.12-20150511.jar" />
<pathelement location="${lib}/poi-scratchpad-3.12-20150511.jar" />
<pathelement location="${lib}/poi-3.13-20150929.jar" />
<pathelement location="${lib}/poi-scratchpad-3.13-20150929.jar" />
<pathelement location="${lib}/slf4j-api-1.7.12.jar" />
<pathelement location="${lib}/slf4j-jdk14-1.7.12.jar" />
<pathelement location="${lib}/solr-core-5.2.1.jar" />
<pathelement location="${lib}/solr-solrj-5.2.1.jar" />
<pathelement location="${lib}/solr-core-5.3.1.jar" />
<pathelement location="${lib}/solr-solrj-5.3.1.jar" />
<pathelement location="${lib}/spatial4j-0.4.1.jar" />
<pathelement location="${lib}/stax2-api_3.1.4.jar" />
<pathelement location="${lib}/webcat-0.1-swf.jar" />

@ -316,7 +316,7 @@ public class yacysearchitem {
final String license = URLLicense.aquireLicense(image.imageUrl); // this is just the license key to get the image forwarded through the YaCy thumbnail viewer, not an actual lawful license
//sb.loader.loadIfNotExistBackground(image.imageUrl, 1024 * 1024 * 10, null, ClientIdentification.yacyIntranetCrawlerAgent);
prop.putHTML("content_item_hrefCache", "ViewImage." + ("gif.png.svg".contains(imageUrlExt) ? imageUrlExt : "png") + "?maxwidth=128&maxheight=128&code="+license+"&isStatic=true&quadratic=&url=" + imageUrlstring);
prop.putHTML("content_item_hrefCache", "ViewImage." + (!imageUrlExt.isEmpty() && "gif.png.svg".contains(imageUrlExt) ? imageUrlExt : "png") + "?maxwidth=128&maxheight=128&code="+license+"&isStatic=true&quadratic=&url=" + imageUrlstring);
prop.putHTML("content_item_href", imageUrlstring);
prop.putHTML("content_item_target", target);
prop.put("content_item_code", license);

@ -26,10 +26,9 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import org.apache.solr.schema.TrieDateField;
import org.apache.solr.util.DateFormatUtil;
import net.yacy.cora.date.AbstractFormatter;
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.document.analysis.Classification.ContentDomain;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.lod.vocabulary.Tagging;
@ -401,13 +400,13 @@ public class yacysearchtrailer {
String shortname = name.substring(0, 10);
long d;
Date dd;
try {dd = TrieDateField.parseDate(name); d = dd.getTime();} catch (ParseException e) {continue;}
try {dd = DateFormatUtil.parseDate(name); d = dd.getTime();} catch (ParseException e) {continue;}
if (fromconstraint != null && dd.before(fromconstraint)) continue;
if (toconstraint != null && dd.after(toconstraint)) break;
if (dx > 0) {
while (d - dx > AbstractFormatter.dayMillis) {
dx += AbstractFormatter.dayMillis;
String sn = TrieDateField.formatExternal(new Date(dx)).substring(0, 10);
String sn = DateFormatUtil.formatExternal(new Date(dx)).substring(0, 10);
prop.put("nav-dates_element_" + i + "_on", 0);
prop.put(fileType, "nav-dates_element_" + i + "_name", sn);
prop.put("nav-dates_element_" + i + "_count", 0);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -83,7 +83,7 @@
<compilation-unit>
<package-root>source</package-root>
<package-root>htroot</package-root>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-1.46.jar;lib/bcprov-jdk15-1.46.jar;lib/chardet.jar;lib/commons-codec-1.10.jar;lib/commons-compress-1.9.jar;lib/commons-fileupload-1.3.1.jar;lib/commons-io-2.4.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.2.jar;lib/fontbox-1.8.10.jar;lib/guava-18.0.jar;lib/htmllexer.jar;lib/httpclient-4.5.jar;lib/httpcore-4.4.1.jar;lib/httpmime-4.5.jar;lib/icu4j-55_1.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.12.jar;lib/jempbox-1.8.10.jar;lib/jetty-client-9.2.11.v20150529.jar;lib/jetty-continuation-9.2.11.v20150529.jar;lib/jetty-deploy-9.2.11.v20150529.jar;lib/jetty-http-9.2.11.v20150529.jar;lib/jetty-io-9.2.11.v20150529.jar;lib/jetty-jmx-9.2.11.v20150529.jar;lib/jetty-proxy-9.2.11.v20150529.jar;lib/jetty-security-9.2.11.v20150529.jar;lib/jetty-server-9.2.11.v20150529.jar;lib/jetty-servlet-9.2.11.v20150529.jar;lib/jetty-servlets-9.2.11.v20150529.jar;lib/jetty-util-9.2.11.v20150529.jar;lib/jetty-webapp-9.2.11.v20150529.jar;lib/jetty-xml-9.2.11.v20150529.jar;lib/jsch-0.1.53.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.8.3.jar;lib/log4j-over-slf4j-1.7.12.jar;lib/lucene-analyzers-common-5.2.1.jar;lib/lucene-analyzers-phonetic-5.2.1.jar;lib/lucene-backward-codecs-5.2.1.jar;lib/lucene-classification-5.2.1.jar;lib/lucene-codecs-5.2.1.jar;lib/lucene-core-5.2.1.jar;lib/lucene-facet-5.2.1.jar;lib/lucene-grouping-5.2.1.jar;lib/lucene-highlighter-5.2.1.jar;lib/lucene-join-5.2.1.jar;lib/lucene-memory-5.2.1.jar;lib/lucene-misc-5.2.1.jar;lib/lucene-queries-5.2.1.jar;lib/lucene-queryparser-5.2.1.jar;lib/lucene-spatial-5.2.1.jar;lib/lucene-suggest-5.2.1.jar;lib/metadata-extractor-2.8.1.jar;lib/noggit-0.6.jar;lib/org.restlet.jar;lib/pdfbox-1.8.10.jar;lib/poi-3.12-20150511.jar;lib/poi-scratchpad-3.12-20150511.jar;lib/slf4j-api-1.7.12.jar;lib/slf4j-jdk14-1.7.12.jar;lib/solr-core-5.2.1.jar;lib/solr-solrj-5.2.1.jar;lib/spatial4j-0.4.1.jar;lib/stax2-api-3.1.4.jar;lib/webcat-0.1-swf.jar;lib/weupnp-0.1.3.jar;lib/woodstox-core-asl-4.4.1.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/xmpcore-5.1.2.jar;lib/zookeeper-3.4.6.jar</classpath>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-1.46.jar;lib/bcprov-jdk15-1.46.jar;lib/chardet.jar;lib/commons-codec-1.10.jar;lib/commons-compress-1.9.jar;lib/commons-fileupload-1.3.1.jar;lib/commons-io-2.4.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.2.jar;lib/fontbox-1.8.10.jar;lib/guava-18.0.jar;lib/htmllexer.jar;lib/httpclient-4.5.jar;lib/httpcore-4.4.1.jar;lib/httpmime-4.5.jar;lib/icu4j-55_1.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.12.jar;lib/jempbox-1.8.10.jar;lib/jetty-client-9.2.11.v20150529.jar;lib/jetty-continuation-9.2.11.v20150529.jar;lib/jetty-deploy-9.2.11.v20150529.jar;lib/jetty-http-9.2.11.v20150529.jar;lib/jetty-io-9.2.11.v20150529.jar;lib/jetty-jmx-9.2.11.v20150529.jar;lib/jetty-proxy-9.2.11.v20150529.jar;lib/jetty-security-9.2.11.v20150529.jar;lib/jetty-server-9.2.11.v20150529.jar;lib/jetty-servlet-9.2.11.v20150529.jar;lib/jetty-servlets-9.2.11.v20150529.jar;lib/jetty-util-9.2.11.v20150529.jar;lib/jetty-webapp-9.2.11.v20150529.jar;lib/jetty-xml-9.2.11.v20150529.jar;lib/jsch-0.1.53.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.8.3.jar;lib/log4j-over-slf4j-1.7.12.jar;lib/lucene-analyzers-common-5.3.1.jar;lib/lucene-analyzers-phonetic-5.3.1.jar;lib/lucene-backward-codecs-5.3.1.jar;lib/lucene-classification-5.3.1.jar;lib/lucene-codecs-5.3.1.jar;lib/lucene-core-5.3.1.jar;lib/lucene-facet-5.3.1.jar;lib/lucene-grouping-5.3.1.jar;lib/lucene-highlighter-5.3.1.jar;lib/lucene-join-5.3.1.jar;lib/lucene-memory-5.3.1.jar;lib/lucene-misc-5.3.1.jar;lib/lucene-queries-5.3.1.jar;lib/lucene-queryparser-5.3.1.jar;lib/lucene-spatial-5.3.1.jar;lib/lucene-suggest-5.3.1.jar;lib/metadata-extractor-2.8.1.jar;lib/noggit-0.6.jar;lib/org.restlet.jar;lib/pdfbox-1.8.10.jar;lib/poi-3.13-20150929.jar;lib/poi-scratchpad-3.13-20150929.jar;lib/slf4j-api-1.7.12.jar;lib/slf4j-jdk14-1.7.12.jar;lib/solr-core-5.3.1.jar;lib/solr-solrj-5.3.1.jar;lib/spatial4j-0.4.1.jar;lib/stax2-api-3.1.4.jar;lib/webcat-0.1-swf.jar;lib/weupnp-0.1.3.jar;lib/woodstox-core-asl-4.4.1.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/xmpcore-5.1.2.jar;lib/zookeeper-3.4.6.jar</classpath>
<built-to>lib/yacycore.jar</built-to>
<source-level>1.7</source-level>
</compilation-unit>

@ -34,7 +34,7 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<!-- the Solr version used in dependency section for all related dependencies -->
<solr.version>5.2.1</solr.version>
<solr.version>5.3.1</solr.version>
<!-- the Jetty version used in dependency section for all related dependencies -->
<jetty.version>9.2.11.v20150529</jetty.version>
@ -498,12 +498,12 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
<version>3.13</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.12</version>
<version>3.13</version>
</dependency>
<dependency>
<groupId>sax</groupId>

@ -48,10 +48,10 @@ import org.apache.solr.schema.FieldType;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.schema.TextField;
import org.apache.solr.schema.TrieDateField;
import org.apache.solr.search.DocIterator;
import org.apache.solr.search.DocList;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.util.DateFormatUtil;
public class EnhancedXMLResponseWriter implements QueryResponseWriter {
@ -270,7 +270,7 @@ public class EnhancedXMLResponseWriter implements QueryResponseWriter {
} else if (typeName.equals(SolrType.num_long.printName())) {
writeTag(writer, "long", name, value, true);
} else if (typeName.equals(SolrType.date.printName())) {
writeTag(writer, "date", name, TrieDateField.formatExternal(new Date(Long.parseLong(value))), true);
writeTag(writer, "date", name, DateFormatUtil.formatExternal(new Date(Long.parseLong(value))), true);
} else if (typeName.equals(SolrType.num_float.printName())) {
writeTag(writer, "float", name, value, true);
} else if (typeName.equals(SolrType.num_double.printName())) {
@ -288,7 +288,7 @@ public class EnhancedXMLResponseWriter implements QueryResponseWriter {
} else if (value instanceof Long) {
writeTag(writer, "long", name, ((Long) value).toString(), true);
} else if (value instanceof Date) {
writeTag(writer, "date", name, TrieDateField.formatExternal((Date) value), true);
writeTag(writer, "date", name, DateFormatUtil.formatExternal((Date) value), true);
} else if (value instanceof Float) {
writeTag(writer, "float", name, ((Float) value).toString(), true);
} else if (value instanceof Double) {

@ -45,10 +45,10 @@ import org.apache.solr.schema.FieldType;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.schema.TextField;
import org.apache.solr.schema.TrieDateField;
import org.apache.solr.search.DocIterator;
import org.apache.solr.search.DocList;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.util.DateFormatUtil;
public class HTMLResponseWriter implements QueryResponseWriter {
@ -223,7 +223,7 @@ public class HTMLResponseWriter implements QueryResponseWriter {
if (typeName.equals(SolrType.bool.printName())) {
return "F".equals(value) ? "false" : "true";
} else if (typeName.equals(SolrType.date.printName())) {
return TrieDateField.formatExternal(new Date(Long.parseLong(value)));
return DateFormatUtil.formatExternal(new Date(Long.parseLong(value)));
}
return value;
}

@ -98,7 +98,7 @@ public class HostQueue implements Balancer {
int p = filename.lastIndexOf('.');
if (p < 0) throw new RuntimeException("hostPath name must contain a dot: " + filename);
this.hostName = filename.substring(0, p);
this.port = Integer.parseInt(filename.substring(p + 1));
this.port = Integer.parseInt(filename.substring(p + 1)); // consider "host.com" contains dot but no required port -> will throw exception
init();
}

@ -57,6 +57,7 @@ public class RecrawlBusyThread extends AbstractBusyThread {
final Switchboard sb;
private final Set<DigestURL> urlstack; // buffer of urls to recrawl
public long urlsfound = 0;
private String solrSortBy;
public RecrawlBusyThread(Switchboard xsb) {
super(3000, 1000); // set lower limits of cycle delay
@ -66,6 +67,9 @@ public class RecrawlBusyThread extends AbstractBusyThread {
this.sb = xsb;
urlstack = new HashSet<DigestURL>();
// workaround to prevent solr exception on existing index (not fully reindexed) since intro of schema with docvalues
// org.apache.solr.core.SolrCore java.lang.IllegalStateException: unexpected docvalues type NONE for field 'load_date_dt' (expected=NUMERIC). Use UninvertingReader or index with docvalues.
solrSortBy = null; // CollectionSchema.load_date_dt.getSolrFieldName() + " asc";
}
/**
@ -168,7 +172,7 @@ public class RecrawlBusyThread extends AbstractBusyThread {
try {
// query all or only httpstatus=200 depending on includefailed flag
docList = solrConnector.getDocumentListByQuery(this.includefailed ? currentQuery : currentQuery + " AND (" + CollectionSchema.httpstatus_i.name() + ":200)",
CollectionSchema.load_date_dt.getSolrFieldName() + " asc", this.chunkstart, this.chunksize, CollectionSchema.sku.getSolrFieldName());
this.solrSortBy, this.chunkstart, this.chunksize, CollectionSchema.sku.getSolrFieldName());
this.urlsfound = docList.getNumFound();
} catch (Throwable e) {
this.urlsfound = 0;

@ -129,6 +129,12 @@ public class genericImageParser extends AbstractParser implements Parser {
byte[] b;
try {
b = FileUtils.read(source);
// check jpeg file signature (magic number FF D8 FF)
if ((b[0] != (byte) 0xFF) // cast to signed byte (-1)
|| (b[1] != (byte) 0xD8) //cast to signed byte (-40)
|| (b[2] != (byte) 0xFF)) {
throw new Parser.Failure("File has no jpeg signature", location);
}
} catch (final IOException e) {
ConcurrentLog.logException(e);
throw new Parser.Failure(e.getMessage(), location);

@ -26,7 +26,7 @@ import java.util.Date;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.MultiMapSolrParams;
import org.apache.solr.schema.TrieDateField;
import org.apache.solr.util.DateFormatUtil;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.util.CommonPattern;
@ -355,7 +355,7 @@ public class QueryModifier {
Date onDate = DateDetection.parseLine(onDescription, timezoneOffset);
StringBuilder filterQuery = new StringBuilder(20);
if (onDate != null) {
String dstr = TrieDateField.formatExternal(onDate);
String dstr = DateFormatUtil.formatExternal(onDate);
filterQuery.append(CollectionSchema.dates_in_content_dts.getSolrFieldName()).append(":[").append(dstr).append(" TO ").append(dstr).append(']');
}
return filterQuery.toString();
@ -366,8 +366,8 @@ public class QueryModifier {
Date toDate = to == null || to.equals("*") ? null : DateDetection.parseLine(to, timezoneOffset);
StringBuilder filterQuery = new StringBuilder(20);
if (fromDate != null && toDate != null) {
String dstrFrom = fromDate == null ? "*" : TrieDateField.formatExternal(fromDate);
String dstrTo = toDate == null ? "*" : TrieDateField.formatExternal(toDate);
String dstrFrom = fromDate == null ? "*" : DateFormatUtil.formatExternal(fromDate);
String dstrTo = toDate == null ? "*" : DateFormatUtil.formatExternal(toDate);
filterQuery.append(CollectionSchema.dates_in_content_dts.getSolrFieldName()).append(":[").append(dstrFrom).append(" TO ").append(dstrTo).append(']');
}
return filterQuery.toString();

@ -73,7 +73,7 @@ import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrQuery.SortClause;
import org.apache.solr.common.params.DisMaxParams;
import org.apache.solr.common.params.FacetParams;
import org.apache.solr.schema.TrieDateField;
import org.apache.solr.util.DateFormatUtil;
public final class QueryParams {
@ -465,8 +465,8 @@ public final class QueryParams {
for (String field: this.facetfields) params.addFacetField("{!ex=" + field + "}" + field); // params.addFacetField("{!ex=" + field + "}" + field);
if (this.facetfields.contains(CollectionSchema.dates_in_content_dts.name())) {
params.setParam(FacetParams.FACET_RANGE, CollectionSchema.dates_in_content_dts.name());
String start = TrieDateField.formatExternal(new Date(System.currentTimeMillis() - 1000L * 60L * 60L * 24L * 3));
String end = TrieDateField.formatExternal(new Date(System.currentTimeMillis() + 1000L * 60L * 60L * 24L * 3));
String start = DateFormatUtil.formatExternal(new Date(System.currentTimeMillis() - 1000L * 60L * 60L * 24L * 3));
String end = DateFormatUtil.formatExternal(new Date(System.currentTimeMillis() + 1000L * 60L * 60L * 24L * 3));
params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.start", start);
params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.end", end);
params.setParam("f." + CollectionSchema.dates_in_content_dts.getSolrFieldName() + ".facet.range.gap", "+1DAY");

@ -69,6 +69,7 @@ import net.yacy.search.Switchboard;
import net.yacy.search.schema.CollectionSchema;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.FacetParams;
import org.apache.solr.common.params.MultiMapSolrParams;
@ -552,7 +553,7 @@ public class serverObjects implements Serializable, Cloneable {
if (facets != null && facets.length > 0) {
this.remove("facet");
this.put("facet", "true");
for (int i = 0; i < facets.length; i++) this.add("facet.field", facets[i].getSolrFieldName());
for (int i = 0; i < facets.length; i++) this.add(FacetParams.FACET_FIELD, facets[i].getSolrFieldName());
}
return this.map;
}

Loading…
Cancel
Save