diff --git a/.classpath b/.classpath index d3665f212..7cf627838 100644 --- a/.classpath +++ b/.classpath @@ -1,91 +1,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addon/YaCy.app/Contents/Info.plist b/addon/YaCy.app/Contents/Info.plist index db0dac042..e30ebf920 100644 --- a/addon/YaCy.app/Contents/Info.plist +++ b/addon/YaCy.app/Contents/Info.plist @@ -25,7 +25,7 @@ Java VMOptions - -Xmx600m -Xms90m -Dsolr.directoryFactory=solr.MMapDirectoryFactory -Dfile.encoding=UTF-8 + -server -d64 -Xmx600m -Xms90m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8 -Dsolr.directoryFactory=solr.MMapDirectoryFactory WorkingDirectory $APP_PACKAGE/Contents/Resources/Java MainClass @@ -58,9 +58,9 @@ $JAVAROOT/lib/commons-jxpath-1.3.jar $JAVAROOT/lib/commons-lang-2.6.jar $JAVAROOT/lib/commons-logging-1.1.3.jar - $JAVAROOT/lib/fontbox-1.8.2.jar + $JAVAROOT/lib/fontbox-1.8.3.jar $JAVAROOT/lib/geronimo-stax-api_1.0_spec-1.0.1.jar - $JAVAROOT/lib/guava-13.0.1.jar + $JAVAROOT/lib/guava-15.0.jar $JAVAROOT/lib/htmllexer.jar $JAVAROOT/lib/httpclient-4.3.1.jar $JAVAROOT/lib/httpcore-4.3.jar @@ -72,37 +72,36 @@ $JAVAROOT/lib/jaudiotagger-2.0.4-20111207.115108-15.jar $JAVAROOT/lib/jcifs-1.3.17.jar $JAVAROOT/lib/jcl-over-slf4j-1.7.2.jar - $JAVAROOT/lib/jempbox-1.8.2.jar + $JAVAROOT/lib/jempbox-1.8.3.jar $JAVAROOT/lib/jena-2.6.4.jar - $JAVAROOT/lib/jsch-0.1.42.jar - $JAVAROOT/lib/json-simple-1.1.jar + $JAVAROOT/lib/jsch-0.1.50.jar + $JAVAROOT/lib/json-simple-1.1.1.jar $JAVAROOT/lib/log4j-over-slf4j-1.7.2.jar - $JAVAROOT/lib/lucene-analyzers-common-4.5.0.jar - $JAVAROOT/lib/lucene-analyzers-phonetic-4.5.0.jar - $JAVAROOT/lib/lucene-classification-4.5.0.jar - $JAVAROOT/lib/lucene-codecs-4.5.0.jar - $JAVAROOT/lib/lucene-core-4.5.0.jar - $JAVAROOT/lib/lucene-facet-4.5.0.jar - $JAVAROOT/lib/lucene-grouping-4.5.0.jar - $JAVAROOT/lib/lucene-highlighter-4.5.0.jar - $JAVAROOT/lib/lucene-join-4.5.0.jar - $JAVAROOT/lib/lucene-memory-4.5.0.jar - $JAVAROOT/lib/lucene-misc-4.5.0.jar - $JAVAROOT/lib/lucene-queries-4.5.0.jar - $JAVAROOT/lib/lucene-queryparser-4.5.0.jar - $JAVAROOT/lib/lucene-spatial-4.5.0.jar - $JAVAROOT/lib/lucene-suggest-4.5.0.jar + $JAVAROOT/lib/lucene-analyzers-common-4.6.0.jar + $JAVAROOT/lib/lucene-analyzers-phonetic-4.6.0.jar + $JAVAROOT/lib/lucene-classification-4.6.0.jar + $JAVAROOT/lib/lucene-codecs-4.6.0.jar + $JAVAROOT/lib/lucene-core-4.6.0.jar + $JAVAROOT/lib/lucene-facet-4.6.0.jar + $JAVAROOT/lib/lucene-grouping-4.6.0.jar + $JAVAROOT/lib/lucene-highlighter-4.6.0.jar + $JAVAROOT/lib/lucene-join-4.6.0.jar + $JAVAROOT/lib/lucene-memory-4.6.0.jar + $JAVAROOT/lib/lucene-misc-4.6.0.jar + $JAVAROOT/lib/lucene-queries-4.6.0.jar + $JAVAROOT/lib/lucene-queryparser-4.6.0.jar + $JAVAROOT/lib/lucene-spatial-4.6.0.jar + $JAVAROOT/lib/lucene-suggest-4.6.0.jar $JAVAROOT/lib/metadata-extractor-2.6.2.jar - $JAVAROOT/lib/mysql-connector-java-5.1.12-bin.jar $JAVAROOT/lib/noggit-0.5.jar - $JAVAROOT/lib/pdfbox-1.8.2.jar + $JAVAROOT/lib/pdfbox-1.8.3.jar $JAVAROOT/lib/poi-3.6-20091214.jar $JAVAROOT/lib/poi-scratchpad-3.6-20091214.jar $JAVAROOT/lib/sax-2.0.1.jar $JAVAROOT/lib/slf4j-api-1.7.2.jar $JAVAROOT/lib/slf4j-jdk14-1.7.2.jar - $JAVAROOT/lib/solr-core-4.5.0.jar - $JAVAROOT/lib/solr-solrj-4.5.0.jar + $JAVAROOT/lib/solr-core-4.6.0.jar + $JAVAROOT/lib/solr-solrj-4.6.0.jar $JAVAROOT/lib/spatial4j-0.3.jar $JAVAROOT/lib/webcat-0.1-swf.jar $JAVAROOT/lib/wstx-asl-3.2.9.jar diff --git a/addon/yacyInit.m4 b/addon/yacyInit.m4 index c866781f7..789522c15 100644 --- a/addon/yacyInit.m4 +++ b/addon/yacyInit.m4 @@ -57,12 +57,13 @@ SHUTDOWN_TIMEOUT=50 # Default niceness if not set in config file NICE_VAL=0 -JAVA_ARGS="-server -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseGCOverheadLimit -XX:+UseAdaptiveSizePolicy -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encoding=UTF-8" +JAVA_ARGS="-server -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dfile.encoding=UTF-8" + #check if system supports large memory pages and enable it if possible HUGEPAGESTOTAL="$(cat /proc/meminfo | grep HugePages_Total | sed s/[^0-9]//g)" if [ -n "$HUGEPAGESTOTAL" ] && [ $HUGEPAGESTOTAL -ne 0 ] then - JAVA_ARGS="$JAVA_ARGS -XX:+UseLargePages" + JAVA_ARGS="$JAVA_ARGS -XX:+UseLargePages -d64 -Dsolr.directoryFactory=solr.MMapDirectoryFactory" fi ifdef(`openSUSE', `dnl diff --git a/build.xml b/build.xml index 4b1ea5036..040eae768 100644 --- a/build.xml +++ b/build.xml @@ -184,9 +184,9 @@ - + - + @@ -198,38 +198,37 @@ - + - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + - - + + diff --git a/defaults/solr/solrconfig.xml b/defaults/solr/solrconfig.xml index e0f895152..5e14661a0 100644 --- a/defaults/solr/solrconfig.xml +++ b/defaults/solr/solrconfig.xml @@ -35,7 +35,7 @@ that you fully re-index after changing this setting as it can affect both how text is indexed and queried. --> - 4.5 + 4.6 + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:md="http://localhost:8090/api/schema.xml?core=collection1" +> @@ -23,6 +25,15 @@ de 2009-03-02T11:12:36Z + Alan Smithee + Geschichte + Entstehung + Aufdeckung und Abkehr + Verwendung + Literatur + Weblinks + Referenzen + surrogate diff --git a/htroot/solr/select.java b/htroot/solr/select.java index 77c99a592..acdbe16c2 100644 --- a/htroot/solr/select.java +++ b/htroot/solr/select.java @@ -51,7 +51,7 @@ import net.yacy.server.serverSwitch; import org.apache.solr.common.SolrDocumentList; import org.apache.solr.common.SolrException; import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.SolrParams; +import org.apache.solr.common.params.MultiMapSolrParams; import org.apache.solr.common.util.NamedList; import org.apache.solr.core.SolrCore; import org.apache.solr.request.SolrQueryRequest; @@ -152,43 +152,53 @@ public class select { } sb.intermissionAllThreads(3000); // tell all threads to do nothing for a specific time + MultiMapSolrParams mmsp = post.toSolrParams(/*responseWriter instanceof JsonResponseWriter ? new YaCySchema[]{YaCySchema.host_s, YaCySchema.url_file_ext_s, YaCySchema.url_protocol_s} :*/ null); + // count remote searches if this was part of a p2p search - if (post.containsKey("partitions")) { - final int partitions = post.getInt("partitions", 30); + if (mmsp.getMap().containsKey("partitions")) { + final int partitions = mmsp.getInt("partitions", 30); sb.searchQueriesGlobal += 1.0f / partitions; // increase query counter } // get the ranking profile id - int profileNr = post.getInt("profileNr", 0); + int profileNr = mmsp.getInt("profileNr", 0); // rename post fields according to result style - if (!post.containsKey(CommonParams.Q) && post.containsKey("query")) { - String querystring = post.get("query", ""); - post.remove("query"); + if (!mmsp.getMap().containsKey(CommonParams.Q) && mmsp.getMap().containsKey("query")) { + String querystring = mmsp.get("query", ""); + mmsp.getMap().remove("query"); QueryModifier modifier = new QueryModifier(); querystring = modifier.parse(querystring); - modifier.apply(post); + modifier.apply(mmsp); QueryGoal qg = new QueryGoal(querystring, querystring); StringBuilder solrQ = qg.collectionTextQueryString(sb.index.fulltext().getDefaultConfiguration(), profileNr, false); - post.put(CommonParams.Q, solrQ.toString()); // sru patch + mmsp.getMap().put(CommonParams.Q, new String[]{solrQ.toString()}); // sru patch + } + String q = mmsp.get(CommonParams.Q, ""); + if (!mmsp.getMap().containsKey(CommonParams.START)) { + int startRecord = mmsp.getFieldInt("startRecord", "0"); + mmsp.getMap().remove("startRecord"); + mmsp.getMap().put(CommonParams.START, new String[]{Integer.toString(startRecord)}); // sru patch + } + if (!mmsp.getMap().containsKey(CommonParams.ROWS)) { + int maximumRecords = mmsp.getFieldInt("maximumRecords", "10"); + mmsp.getMap().remove("maximumRecords"); + mmsp.getMap().put(CommonParams.ROWS, new String[]{Integer.toString(maximumRecords)}); // sru patch } - String q = post.get(CommonParams.Q, ""); - if (!post.containsKey(CommonParams.START)) post.put(CommonParams.START, post.remove("startRecord", 0)); // sru patch - if (!post.containsKey(CommonParams.ROWS)) post.put(CommonParams.ROWS, post.remove("maximumRecords", 10)); // sru patch - post.put(CommonParams.ROWS, Math.min(post.getInt(CommonParams.ROWS, 10), (authenticated) ? 100000000 : 100)); + mmsp.getMap().put(CommonParams.ROWS, new String[]{Integer.toString(Math.min(mmsp.getInt(CommonParams.ROWS, 10), (authenticated) ? 100000000 : 100))}); // set ranking according to profile number if ranking attributes are not given in the request - if (!post.containsKey("sort") && !post.containsKey("bq") && !post.containsKey("bf") && !post.containsKey("boost")) { - if (!post.containsKey("defType")) post.put("defType", "edismax"); + if (!mmsp.getMap().containsKey("sort") && !mmsp.getMap().containsKey("bq") && !mmsp.getMap().containsKey("bf") && !mmsp.getMap().containsKey("boost")) { + if (!mmsp.getMap().containsKey("defType")) mmsp.getMap().put("defType", new String[]{"edismax"}); Ranking ranking = sb.index.fulltext().getDefaultConfiguration().getRanking(profileNr); String bq = ranking.getBoostQuery(); String bf = ranking.getBoostFunction(); - if (bq.length() > 0) post.put("bq", bq); - if (bf.length() > 0) post.put("boost", bf); // a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29 + if (bq.length() > 0) mmsp.getMap().put("bq", new String[]{bq}); + if (bf.length() > 0) mmsp.getMap().put("boost", new String[]{bf}); // a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29 } // get a response writer for the result - String wt = post.get(CommonParams.WT, "xml"); // maybe use /solr/select?q=*:*&start=0&rows=10&wt=exml + String wt = mmsp.get(CommonParams.WT, "xml"); // maybe use /solr/select?q=*:*&start=0&rows=10&wt=exml QueryResponseWriter responseWriter = RESPONSE_WRITER.get(wt); if (responseWriter == null) return null; if (responseWriter instanceof OpensearchResponseWriter) { @@ -201,40 +211,39 @@ public class select { } // if this is a call to YaCys special search formats, enhance the query with field assignments - if ((responseWriter instanceof YJsonResponseWriter || responseWriter instanceof OpensearchResponseWriter) && "true".equals(post.get("hl", "true"))) { + if ((responseWriter instanceof YJsonResponseWriter || responseWriter instanceof OpensearchResponseWriter) && "true".equals(mmsp.get("hl", "true"))) { // add options for snippet generation - if (!post.containsKey("hl.q")) post.put("hl.q", q); - if (!post.containsKey("hl.fl")) post.put("hl.fl", CollectionSchema.h1_txt.getSolrFieldName() + "," + CollectionSchema.h2_txt.getSolrFieldName() + "," + CollectionSchema.text_t.getSolrFieldName()); - if (!post.containsKey("hl.alternateField")) post.put("hl.alternateField", CollectionSchema.description_txt.getSolrFieldName()); - if (!post.containsKey("hl.simple.pre")) post.put("hl.simple.pre", ""); - if (!post.containsKey("hl.simple.post")) post.put("hl.simple.post", ""); - if (!post.containsKey("hl.fragsize")) post.put("hl.fragsize", Integer.toString(SearchEvent.SNIPPET_MAX_LENGTH)); + if (!mmsp.getMap().containsKey("hl.q")) mmsp.getMap().put("hl.q", new String[]{q}); + if (!mmsp.getMap().containsKey("hl.fl")) mmsp.getMap().put("hl.fl", new String[]{CollectionSchema.h1_txt.getSolrFieldName() + "," + CollectionSchema.h2_txt.getSolrFieldName() + "," + CollectionSchema.text_t.getSolrFieldName()}); + if (!mmsp.getMap().containsKey("hl.alternateField")) mmsp.getMap().put("hl.alternateField", new String[]{CollectionSchema.description_txt.getSolrFieldName()}); + if (!mmsp.getMap().containsKey("hl.simple.pre")) mmsp.getMap().put("hl.simple.pre", new String[]{""}); + if (!mmsp.getMap().containsKey("hl.simple.post")) mmsp.getMap().put("hl.simple.post", new String[]{""}); + if (!mmsp.getMap().containsKey("hl.fragsize")) mmsp.getMap().put("hl.fragsize", new String[]{Integer.toString(SearchEvent.SNIPPET_MAX_LENGTH)}); } // get the embedded connector - boolean defaultConnector = post == null || post.get("core", CollectionSchema.CORE_NAME).equals(CollectionSchema.CORE_NAME); + boolean defaultConnector = mmsp.get("core", CollectionSchema.CORE_NAME).equals(CollectionSchema.CORE_NAME); EmbeddedSolrConnector connector = defaultConnector ? sb.index.fulltext().getDefaultEmbeddedConnector() : sb.index.fulltext().getEmbeddedConnector(WebgraphSchema.CORE_NAME); if (connector == null) return null; // do the solr request, generate facets if we use a special YaCy format - SolrParams params = post.toSolrParams(/*responseWriter instanceof JsonResponseWriter ? new YaCySchema[]{YaCySchema.host_s, YaCySchema.url_file_ext_s, YaCySchema.url_protocol_s} :*/ null); - SolrQueryRequest req = connector.request(params); + SolrQueryRequest req = connector.request(mmsp); Writer ow = null; - SolrQueryResponse response = null; + SolrQueryResponse rsp = null; try { - response = connector.query(req); - if (response != null) { - Exception e = response.getException(); + rsp = connector.query(req); + if (rsp != null) { + Exception e = rsp.getException(); if (e != null) { ConcurrentLog.logException(e); } else { // write the result directly to the output stream if (responseWriter instanceof BinaryResponseWriter) { - ((BinaryResponseWriter) responseWriter).write(out, req, response); + ((BinaryResponseWriter) responseWriter).write(out, req, rsp); } else { ow = new FastWriter(new OutputStreamWriter(out, UTF8.charset)); - responseWriter.write(ow, req, response); + responseWriter.write(ow, req, rsp); ow.flush(); } } @@ -247,10 +256,10 @@ public class select { SolrRequestInfo.clearRequestInfo(); if (ow != null) try {ow.close();} catch (final IOException e1) {} } - if (response == null) return null; + if (rsp == null) return null; // log result - Object rv = response.getValues().get("response"); + Object rv = rsp.getValues().get("response"); int matches = 0; if (rv != null && rv instanceof ResultContext) { matches = ((ResultContext) rv).docs.matches(); @@ -258,7 +267,7 @@ public class select { matches = (int) ((SolrDocumentList) rv).getNumFound(); } AccessTracker.addToDump(q, Integer.toString(matches)); - ConcurrentLog.info("SOLR Query", "results: " + matches + ", for query:" + post.toString()); + ConcurrentLog.info("SOLR Query", "results: " + matches + ", for query:" + mmsp.toString()); return null; } diff --git a/lib/fontbox-1.8.2.License b/lib/fontbox-1.8.3.License similarity index 100% rename from lib/fontbox-1.8.2.License rename to lib/fontbox-1.8.3.License diff --git a/lib/fontbox-1.8.2.jar b/lib/fontbox-1.8.3.jar similarity index 66% rename from lib/fontbox-1.8.2.jar rename to lib/fontbox-1.8.3.jar index 517a91c12..67a480b36 100644 Binary files a/lib/fontbox-1.8.2.jar and b/lib/fontbox-1.8.3.jar differ diff --git a/lib/guava-13.0.1.jar b/lib/guava-13.0.1.jar deleted file mode 100644 index 09c544911..000000000 Binary files a/lib/guava-13.0.1.jar and /dev/null differ diff --git a/lib/guava-15.0.jar b/lib/guava-15.0.jar new file mode 100644 index 000000000..eb9ef8ad5 Binary files /dev/null and b/lib/guava-15.0.jar differ diff --git a/lib/jempbox-1.8.2.License b/lib/jempbox-1.8.3.License similarity index 100% rename from lib/jempbox-1.8.2.License rename to lib/jempbox-1.8.3.License diff --git a/lib/jempbox-1.8.2.jar b/lib/jempbox-1.8.3.jar similarity index 70% rename from lib/jempbox-1.8.2.jar rename to lib/jempbox-1.8.3.jar index df3aaa0fa..fde047897 100644 Binary files a/lib/jempbox-1.8.2.jar and b/lib/jempbox-1.8.3.jar differ diff --git a/lib/jsch-0.1.42.jar b/lib/jsch-0.1.42.jar deleted file mode 100644 index c65eff095..000000000 Binary files a/lib/jsch-0.1.42.jar and /dev/null differ diff --git a/lib/jsch-0.1.42.License b/lib/jsch-0.1.50.License similarity index 100% rename from lib/jsch-0.1.42.License rename to lib/jsch-0.1.50.License diff --git a/lib/jsch-0.1.50.jar b/lib/jsch-0.1.50.jar new file mode 100644 index 000000000..85c044f21 Binary files /dev/null and b/lib/jsch-0.1.50.jar differ diff --git a/lib/json-simple-1.1.License b/lib/json-simple-1.1.1.License similarity index 100% rename from lib/json-simple-1.1.License rename to lib/json-simple-1.1.1.License diff --git a/lib/json-simple-1.1.1.jar b/lib/json-simple-1.1.1.jar new file mode 100644 index 000000000..66347a6c8 Binary files /dev/null and b/lib/json-simple-1.1.1.jar differ diff --git a/lib/json-simple-1.1.jar b/lib/json-simple-1.1.jar deleted file mode 100644 index f395f4147..000000000 Binary files a/lib/json-simple-1.1.jar and /dev/null differ diff --git a/lib/lucene-analyzers-common-4.5.0.jar b/lib/lucene-analyzers-common-4.6.0.jar similarity index 89% rename from lib/lucene-analyzers-common-4.5.0.jar rename to lib/lucene-analyzers-common-4.6.0.jar index 2ac54ac26..8306ed731 100644 Binary files a/lib/lucene-analyzers-common-4.5.0.jar and b/lib/lucene-analyzers-common-4.6.0.jar differ diff --git a/lib/lucene-analyzers-phonetic-4.5.0.jar b/lib/lucene-analyzers-phonetic-4.6.0.jar similarity index 90% rename from lib/lucene-analyzers-phonetic-4.5.0.jar rename to lib/lucene-analyzers-phonetic-4.6.0.jar index 87f8d3415..3604fbac1 100644 Binary files a/lib/lucene-analyzers-phonetic-4.5.0.jar and b/lib/lucene-analyzers-phonetic-4.6.0.jar differ diff --git a/lib/lucene-classification-4.5.0.jar b/lib/lucene-classification-4.5.0.jar deleted file mode 100644 index 26ad061ed..000000000 Binary files a/lib/lucene-classification-4.5.0.jar and /dev/null differ diff --git a/lib/lucene-classification-4.6.0.jar b/lib/lucene-classification-4.6.0.jar new file mode 100644 index 000000000..225e28273 Binary files /dev/null and b/lib/lucene-classification-4.6.0.jar differ diff --git a/lib/lucene-codecs-4.5.0.jar b/lib/lucene-codecs-4.6.0.jar similarity index 53% rename from lib/lucene-codecs-4.5.0.jar rename to lib/lucene-codecs-4.6.0.jar index 3df158e9b..4966e2be9 100644 Binary files a/lib/lucene-codecs-4.5.0.jar and b/lib/lucene-codecs-4.6.0.jar differ diff --git a/lib/lucene-core-4.5.0.jar b/lib/lucene-core-4.6.0.jar similarity index 61% rename from lib/lucene-core-4.5.0.jar rename to lib/lucene-core-4.6.0.jar index e710cc776..a71f9d384 100644 Binary files a/lib/lucene-core-4.5.0.jar and b/lib/lucene-core-4.6.0.jar differ diff --git a/lib/lucene-facet-4.5.0.jar b/lib/lucene-facet-4.6.0.jar similarity index 74% rename from lib/lucene-facet-4.5.0.jar rename to lib/lucene-facet-4.6.0.jar index 2d1f558c6..d6894c168 100644 Binary files a/lib/lucene-facet-4.5.0.jar and b/lib/lucene-facet-4.6.0.jar differ diff --git a/lib/lucene-grouping-4.5.0.jar b/lib/lucene-grouping-4.6.0.jar similarity index 84% rename from lib/lucene-grouping-4.5.0.jar rename to lib/lucene-grouping-4.6.0.jar index 4e75486a3..d644e5f19 100644 Binary files a/lib/lucene-grouping-4.5.0.jar and b/lib/lucene-grouping-4.6.0.jar differ diff --git a/lib/lucene-highlighter-4.5.0.jar b/lib/lucene-highlighter-4.6.0.jar similarity index 61% rename from lib/lucene-highlighter-4.5.0.jar rename to lib/lucene-highlighter-4.6.0.jar index e7545d356..2458522ee 100644 Binary files a/lib/lucene-highlighter-4.5.0.jar and b/lib/lucene-highlighter-4.6.0.jar differ diff --git a/lib/lucene-join-4.5.0.jar b/lib/lucene-join-4.6.0.jar similarity index 72% rename from lib/lucene-join-4.5.0.jar rename to lib/lucene-join-4.6.0.jar index b8e3ad7c4..08946134e 100644 Binary files a/lib/lucene-join-4.5.0.jar and b/lib/lucene-join-4.6.0.jar differ diff --git a/lib/lucene-memory-4.5.0.jar b/lib/lucene-memory-4.5.0.jar deleted file mode 100644 index 76ab93ad1..000000000 Binary files a/lib/lucene-memory-4.5.0.jar and /dev/null differ diff --git a/lib/lucene-memory-4.6.0.jar b/lib/lucene-memory-4.6.0.jar new file mode 100644 index 000000000..0f536ddc7 Binary files /dev/null and b/lib/lucene-memory-4.6.0.jar differ diff --git a/lib/lucene-misc-4.5.0.jar b/lib/lucene-misc-4.6.0.jar similarity index 71% rename from lib/lucene-misc-4.5.0.jar rename to lib/lucene-misc-4.6.0.jar index 586fb17c5..1495da99f 100644 Binary files a/lib/lucene-misc-4.5.0.jar and b/lib/lucene-misc-4.6.0.jar differ diff --git a/lib/lucene-queries-4.5.0.jar b/lib/lucene-queries-4.5.0.jar deleted file mode 100644 index 21a916d31..000000000 Binary files a/lib/lucene-queries-4.5.0.jar and /dev/null differ diff --git a/lib/lucene-queries-4.6.0.jar b/lib/lucene-queries-4.6.0.jar new file mode 100644 index 000000000..f99010488 Binary files /dev/null and b/lib/lucene-queries-4.6.0.jar differ diff --git a/lib/lucene-queryparser-4.5.0.jar b/lib/lucene-queryparser-4.6.0.jar similarity index 82% rename from lib/lucene-queryparser-4.5.0.jar rename to lib/lucene-queryparser-4.6.0.jar index fb2c9179e..56cbe60aa 100644 Binary files a/lib/lucene-queryparser-4.5.0.jar and b/lib/lucene-queryparser-4.6.0.jar differ diff --git a/lib/lucene-spatial-4.5.0.jar b/lib/lucene-spatial-4.6.0.jar similarity index 79% rename from lib/lucene-spatial-4.5.0.jar rename to lib/lucene-spatial-4.6.0.jar index a23813033..934fd3bb1 100644 Binary files a/lib/lucene-spatial-4.5.0.jar and b/lib/lucene-spatial-4.6.0.jar differ diff --git a/lib/lucene-suggest-4.5.0.jar b/lib/lucene-suggest-4.5.0.jar deleted file mode 100644 index d80395e74..000000000 Binary files a/lib/lucene-suggest-4.5.0.jar and /dev/null differ diff --git a/lib/lucene-suggest-4.6.0.jar b/lib/lucene-suggest-4.6.0.jar new file mode 100644 index 000000000..1a55946f1 Binary files /dev/null and b/lib/lucene-suggest-4.6.0.jar differ diff --git a/lib/mysql-connector-java-5.1.12-bin.License b/lib/mysql-connector-java-5.1.12-bin.License deleted file mode 100644 index 025ed9e7e..000000000 --- a/lib/mysql-connector-java-5.1.12-bin.License +++ /dev/null @@ -1,343 +0,0 @@ -GNU General Public License -************************** - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public - License is intended to guarantee your freedom to share and change free - software--to make sure the software is free for all its users. This - General Public License applies to most of the Free Software - Foundation's software and to any other program whose authors commit to - using it. (Some other Free Software Foundation software is covered by - the GNU Library General Public License instead.) You can apply it to - your programs, too. - - When we speak of free software, we are referring to freedom, not - price. Our General Public Licenses are designed to make sure that you - have the freedom to distribute copies of free software (and charge for - this service if you wish), that you receive source code or can get it - if you want it, that you can change the software or use pieces of it - in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid - anyone to deny you these rights or to ask you to surrender the rights. - These restrictions translate to certain responsibilities for you if you - distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether - gratis or for a fee, you must give the recipients all the rights that - you have. You must make sure that they, too, receive or can get the - source code. And you must show them these terms so they know their - rights. - - We protect your rights with two steps: (1) copyright the software, and - (2) offer you this license which gives you legal permission to copy, - distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain - that everyone understands that there is no warranty for this free - software. If the software is modified by someone else and passed on, we - want its recipients to know that what they have is not the original, so - that any problems introduced by others will not reflect on the original - authors' reputations. - - Finally, any free program is threatened constantly by software - patents. We wish to avoid the danger that redistributors of a free - program will individually obtain patent licenses, in effect making the - program proprietary. To prevent this, we have made it clear that any - patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and - modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains - a notice placed by the copyright holder saying it may be distributed - under the terms of this General Public License. The "Program", below, - refers to any such program or work, and a "work based on the Program" - means either the Program or any derivative work under copyright law: - that is to say, a work containing the Program or a portion of it, - either verbatim or with modifications and/or translated into another - language. (Hereinafter, translation is included without limitation in - the term "modification".) Each licensee is addressed as "you". - - Activities other than copying, distribution and modification are not - covered by this License; they are outside its scope. The act of - running the Program is not restricted, and the output from the Program - is covered only if its contents constitute a work based on the - Program (independent of having been made by running the Program). - Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's - source code as you receive it, in any medium, provided that you - conspicuously and appropriately publish on each copy an appropriate - copyright notice and disclaimer of warranty; keep intact all the - notices that refer to this License and to the absence of any warranty; - and give any other recipients of the Program a copy of this License - along with the Program. - - You may charge a fee for the physical act of transferring a copy, and - you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion - of it, thus forming a work based on the Program, and copy and - distribute such modifications or work under the terms of Section 1 - above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - - These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the Program, - and can be reasonably considered independent and separate works in - themselves, then this License, and its terms, do not apply to those - sections when you distribute them as separate works. But when you - distribute the same sections as part of a whole which is a work based - on the Program, the distribution of the whole must be on the terms of - this License, whose permissions for other licensees extend to the - entire whole, and thus to each and every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim rights or contest - your rights to work written entirely by you; rather, the intent is to - exercise the right to control the distribution of derivative or - collective works based on the Program. - - In addition, mere aggregation of another work not based on the Program - with the Program (or with a work based on the Program) on a volume of - a storage or distribution medium does not bring the other work under - the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, - under Section 2) in object code or executable form under the terms of - Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - - The source code for a work means the preferred form of the work for - making modifications to it. For an executable work, complete source - code means all the source code for all modules it contains, plus any - associated interface definition files, plus the scripts used to - control compilation and installation of the executable. However, as a - special exception, the source code distributed need not include - anything that is normally distributed (in either source or binary - form) with the major components (compiler, kernel, and so on) of the - operating system on which the executable runs, unless that component - itself accompanies the executable. - - If distribution of executable or object code is made by offering - access to copy from a designated place, then offering equivalent - access to copy the source code from the same place counts as - distribution of the source code, even though third parties are not - compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense or distribute the Program is - void, and will automatically terminate your rights under this License. - However, parties who have received copies, or rights, from you under - this License will not have their licenses terminated so long as such - parties remain in full compliance. - - 5. You are not required to accept this License, since you have not - signed it. However, nothing else grants you permission to modify or - distribute the Program or its derivative works. These actions are - prohibited by law if you do not accept this License. Therefore, by - modifying or distributing the Program (or any work based on the - Program), you indicate your acceptance of this License to do so, and - all its terms and conditions for copying, distributing or modifying - the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the - Program), the recipient automatically receives a license from the - original licensor to copy, distribute or modify the Program subject to - these terms and conditions. You may not impose any further - restrictions on the recipients' exercise of the rights granted herein. - You are not responsible for enforcing compliance by third parties to - this License. - - 7. If, as a consequence of a court judgment or allegation of patent - infringement or for any other reason (not limited to patent issues), - conditions are imposed on you (whether by court order, agreement or - otherwise) that contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you cannot - distribute so as to satisfy simultaneously your obligations under this - License and any other pertinent obligations, then as a consequence you - may not distribute the Program at all. For example, if a patent - license would not permit royalty-free redistribution of the Program by - all those who receive copies directly or indirectly through you, then - the only way you could satisfy both it and this License would be to - refrain entirely from distribution of the Program. - - If any portion of this section is held invalid or unenforceable under - any particular circumstance, the balance of the section is intended to - apply and the section as a whole is intended to apply in other - circumstances. - - It is not the purpose of this section to induce you to infringe any - patents or other property right claims or to contest validity of any - such claims; this section has the sole purpose of protecting the - integrity of the free software distribution system, which is - implemented by public license practices. Many people have made - generous contributions to the wide range of software distributed - through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is willing - to distribute software through any other system and a licensee cannot - impose that choice. - - This section is intended to make thoroughly clear what is believed to - be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in - certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Program under this License - may add an explicit geographical distribution limitation excluding - those countries, so that distribution is permitted only in or among - countries not thus excluded. In such case, this License incorporates - the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions - of the General Public License from time to time. Such new versions will - be similar in spirit to the present version, but may differ in detail to - address new problems or concerns. - - Each version is given a distinguishing version number. If the Program - specifies a version number of this License which applies to it and "any - later version", you have the option of following the terms and conditions - either of that version or of any later version published by the Free - Software Foundation. If the Program does not specify a version number of - this License, you may choose any version ever published by the Free Software - Foundation. - - 10. If you wish to incorporate parts of the Program into other free - programs whose distribution conditions are different, write to the author - to ask for permission. For software which is copyrighted by the Free - Software Foundation, write to the Free Software Foundation; we sometimes - make exceptions for this. Our decision will be guided by the two goals - of preserving the free status of all derivatives of our free software and - of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY - FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN - OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES - PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED - OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS - TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, - REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING - WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, - INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING - OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED - TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY - YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest - possible use to the public, the best way to achieve this is to make it - free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest - to attach them to the start of each source file to most effectively - convey the exclusion of warranty; and each file should have at least - the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Also add information on how to contact you by electronic and paper mail. - - If the program is interactive, make it output a short notice like this - when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the appropriate - parts of the General Public License. Of course, the commands you use may - be called something other than `show w' and `show c'; they could even be - mouse-clicks or menu items--whatever suits your program. - - You should also get your employer (if you work as a programmer) or your - school, if any, to sign a "copyright disclaimer" for the program, if - necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - - This General Public License does not permit incorporating your program into - proprietary programs. If your program is a subroutine library, you may - consider it more useful to permit linking proprietary applications with the - library. If this is what you want to do, use the GNU Library General - Public License instead of this License. - diff --git a/lib/mysql-connector-java-5.1.12-bin.jar b/lib/mysql-connector-java-5.1.12-bin.jar deleted file mode 100644 index af5847eed..000000000 Binary files a/lib/mysql-connector-java-5.1.12-bin.jar and /dev/null differ diff --git a/lib/pdfbox-1.8.2.License b/lib/pdfbox-1.8.3.License similarity index 100% rename from lib/pdfbox-1.8.2.License rename to lib/pdfbox-1.8.3.License diff --git a/lib/pdfbox-1.8.2.jar b/lib/pdfbox-1.8.3.jar similarity index 87% rename from lib/pdfbox-1.8.2.jar rename to lib/pdfbox-1.8.3.jar index e248d069d..a4ca9462d 100644 Binary files a/lib/pdfbox-1.8.2.jar and b/lib/pdfbox-1.8.3.jar differ diff --git a/lib/solr-core-4.5.0.jar b/lib/solr-core-4.6.0.jar similarity index 59% rename from lib/solr-core-4.5.0.jar rename to lib/solr-core-4.6.0.jar index 7704e1c17..f2945dbd7 100644 Binary files a/lib/solr-core-4.5.0.jar and b/lib/solr-core-4.6.0.jar differ diff --git a/lib/solr-solr-4.6.0.License b/lib/solr-solr-4.6.0.License new file mode 100644 index 000000000..534e44ea1 --- /dev/null +++ b/lib/solr-solr-4.6.0.License @@ -0,0 +1,226 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +========================================================================== +The following license applies to the JQuery JavaScript library +-------------------------------------------------------------------------- +Copyright (c) 2010 John Resig, http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/lib/solr-solrj-4.5.0.License b/lib/solr-solrj-4.6.0.License similarity index 100% rename from lib/solr-solrj-4.5.0.License rename to lib/solr-solrj-4.6.0.License diff --git a/lib/solr-solrj-4.5.0.jar b/lib/solr-solrj-4.6.0.jar similarity index 51% rename from lib/solr-solrj-4.5.0.jar rename to lib/solr-solrj-4.6.0.jar index c45dd589a..f6e1c0274 100644 Binary files a/lib/solr-solrj-4.5.0.jar and b/lib/solr-solrj-4.6.0.jar differ diff --git a/source/net/yacy/cora/federate/solr/SolrServlet.java b/source/net/yacy/cora/federate/solr/SolrServlet.java index 200dd66ce..2eb72f8dc 100644 --- a/source/net/yacy/cora/federate/solr/SolrServlet.java +++ b/source/net/yacy/cora/federate/solr/SolrServlet.java @@ -1,255 +1,231 @@ -/** - * SolrServlet - * Copyright 2012 by Michael Peter Christen - * First released 23.08.2012 at http://yacy.net - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program in the file lgpl21.txt - * If not, see . - */ - -package net.yacy.cora.federate.solr; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.Writer; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.yacy.cora.document.encoding.UTF8; -import net.yacy.cora.federate.solr.connector.EmbeddedSolrConnector; -import net.yacy.cora.federate.solr.responsewriter.EnhancedXMLResponseWriter; -import net.yacy.cora.federate.solr.responsewriter.GrepHTMLResponseWriter; -import net.yacy.cora.federate.solr.responsewriter.HTMLResponseWriter; -import net.yacy.cora.federate.solr.responsewriter.OpensearchResponseWriter; -import net.yacy.cora.federate.solr.responsewriter.YJsonResponseWriter; -import net.yacy.cora.util.ConcurrentLog; -import net.yacy.search.Switchboard; -import net.yacy.search.query.AccessTracker; -import net.yacy.search.query.SearchEvent; -import net.yacy.search.schema.CollectionSchema; -import net.yacy.search.schema.WebgraphSchema; - -import org.apache.solr.common.SolrDocumentList; -import org.apache.solr.common.SolrException; -import org.apache.solr.common.params.CommonParams; -import org.apache.solr.common.params.MultiMapSolrParams; -import org.apache.solr.core.SolrCore; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.request.SolrRequestInfo; -import org.apache.solr.response.BinaryResponseWriter; -import org.apache.solr.response.QueryResponseWriter; -import org.apache.solr.response.ResultContext; -import org.apache.solr.response.SolrQueryResponse; -import org.apache.solr.servlet.SolrRequestParsers; -import org.apache.solr.servlet.cache.HttpCacheHeaderUtil; -import org.apache.solr.servlet.cache.Method; -import org.apache.solr.util.FastWriter; - - -public class SolrServlet implements Filter { - - private static EmbeddedSolrConnector connector; - private final Map RESPONSE_WRITER = new HashMap(); - - public SolrServlet() { - } - - @Override - public void init(FilterConfig config) throws ServletException { - - OpensearchResponseWriter opensearchResponseWriter = new OpensearchResponseWriter(); - - // xml and xslt reponseWriter included in SorlCore.DEFAULT_RESPONSE_WRITERS - // DEFAULT_RESPONSE_WRITERS is allways checke, here only additional response writers - RESPONSE_WRITER.put("exml", new EnhancedXMLResponseWriter()); - RESPONSE_WRITER.put("html", new HTMLResponseWriter()); - RESPONSE_WRITER.put("grephtml", new GrepHTMLResponseWriter()); - RESPONSE_WRITER.put("rss", opensearchResponseWriter); //try http://localhost:8090/solr/select?wt=rss&q=olympia&hl=true&hl.fl=text_t,h1,h2 - RESPONSE_WRITER.put("opensearch", opensearchResponseWriter); //try http://localhost:8090/solr/select?wt=rss&q=olympia&hl=true&hl.fl=text_t,h1,h2 - RESPONSE_WRITER.put("yjson", new YJsonResponseWriter()); //try http://localhost:8090/solr/select?wt=json&q=olympia&hl=true&hl.fl=text_t,h1,h2 - // GSA response implemented in separate servlet - // RESPONSE_WRITER.put("gsa", new GSAResponseWriter()); - } - - @Override - public void destroy() { - - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - - if (!(request instanceof HttpServletRequest)) { - if (chain != null) chain.doFilter(request, response); - return; - } - - HttpServletRequest hrequest = (HttpServletRequest) request; - HttpServletResponse hresponse = (HttpServletResponse) response; - - // check if this servlet was called correctly - String pathInfo = hrequest.getPathInfo(); - String path = pathInfo == null ? hrequest.getServletPath() : hrequest.getServletPath() + pathInfo; // should be "/select" after this - - if (!EmbeddedSolrConnector.SELECT.equals(path)) { - // this is not for this servlet - if (chain != null) chain.doFilter(request, response); - return; - } - if (!EmbeddedSolrConnector.CONTEXT.equals(hrequest.getContextPath())) { - // this is not for this servlet - if (chain != null) chain.doFilter(request, response); - return; - } - - // reject POST which is not supported here - final Method reqMethod = Method.getMethod(hrequest.getMethod()); - if (reqMethod == null || (reqMethod != Method.GET && reqMethod != Method.HEAD)) { - throw new ServletException("Unsupported method: " + hrequest.getMethod()); - } - - - // prepare request to solr - MultiMapSolrParams mmsp = SolrRequestParsers.parseQueryString(hrequest.getQueryString()); - String corename = mmsp.get("core",CollectionSchema.CORE_NAME); - - // get the embedded connector - boolean defaultConnector = corename.equals(CollectionSchema.CORE_NAME); - connector = defaultConnector ? Switchboard.getSwitchboard().index.fulltext().getDefaultEmbeddedConnector() : Switchboard.getSwitchboard().index.fulltext().getEmbeddedConnector(WebgraphSchema.CORE_NAME); - - SolrCore core = connector.getCore(); - if (core == null) { - hresponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "core not initialized"); - return; - } - - hrequest.setAttribute("org.apache.solr.CoreContainer", core); - String wt = mmsp.get(CommonParams.WT, "xml"); // maybe use /solr/select?q=*:*&start=0&rows=10&wt=exml - QueryResponseWriter responseWriter = RESPONSE_WRITER.get(wt); // check local response writer - if (responseWriter == null) { - // check default response writer - responseWriter = SolrCore.DEFAULT_RESPONSE_WRITERS.get(wt); - if (responseWriter == null) { - hresponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Solr responsewriter not found for " + wt); - return; +/** + * SolrServlet + * Copyright 2012 by Michael Peter Christen + * First released 23.08.2012 at http://yacy.net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in the file lgpl21.txt + * If not, see . + */ + +package net.yacy.cora.federate.solr; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.Writer; +import java.net.URL; +import java.util.Iterator; +import java.util.Map; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import net.yacy.cora.document.encoding.UTF8; +import net.yacy.cora.federate.solr.connector.EmbeddedSolrConnector; + +import org.apache.solr.common.SolrException; +import org.apache.solr.common.params.MultiMapSolrParams; +import org.apache.solr.core.SolrCore; +import org.apache.solr.request.SolrQueryRequest; +import org.apache.solr.request.SolrRequestInfo; +import org.apache.solr.response.BinaryResponseWriter; +import org.apache.solr.response.QueryResponseWriter; +import org.apache.solr.response.SolrQueryResponse; +import org.apache.solr.response.XMLResponseWriter; +import org.apache.solr.search.DocIterator; +import org.apache.solr.search.DocList; +import org.apache.solr.search.SolrIndexSearcher; +import org.apache.solr.servlet.SolrRequestParsers; +import org.apache.solr.servlet.cache.HttpCacheHeaderUtil; +import org.apache.solr.servlet.cache.Method; +import org.apache.solr.util.FastWriter; + +/* + * taken from the Solr 3.6.0 code, which is now deprecated; + * this is now done in Solr 4.x.x with org.apache.solr.servlet.SolrDispatchFilter + */ +public class SolrServlet implements Filter { + + private static final QueryResponseWriter responseWriter = new XMLResponseWriter(); + private static EmbeddedSolrConnector connector; + + public SolrServlet() { + } + + public static void initCore(EmbeddedSolrConnector c) { + connector = c; + } + + @Override + public void init(FilterConfig config) throws ServletException { + } + + @Override + public void destroy() { + + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + + if (!(request instanceof HttpServletRequest)) { + if (chain != null) chain.doFilter(request, response); + return; + } + + HttpServletRequest hrequest = (HttpServletRequest) request; + HttpServletResponse hresponse = (HttpServletResponse) response; + SolrQueryRequest req = null; + + // check if this servlet was called correctly + String pathInfo = hrequest.getPathInfo(); + String path = pathInfo == null ? hrequest.getServletPath() : hrequest.getServletPath() + pathInfo; // should be "/select" after this + + if (!EmbeddedSolrConnector.SELECT.equals(path)) { + // this is not for this servlet + if (chain != null) chain.doFilter(request, response); + return; + } + if (!EmbeddedSolrConnector.CONTEXT.equals(hrequest.getContextPath())) { + // this is not for this servlet + if (chain != null) chain.doFilter(request, response); + return; + } + + // reject POST which is not supported here + final Method reqMethod = Method.getMethod(hrequest.getMethod()); + if (reqMethod == null || (reqMethod != Method.GET && reqMethod != Method.HEAD)) { + throw new ServletException("Unsupported method: " + hrequest.getMethod()); + } + + Writer out = null; + try { + SolrCore core = connector.getCore(); + if (core == null) { + throw new UnsupportedOperationException("core not initialized"); + } + + // prepare request to solr + hrequest.setAttribute("org.apache.solr.CoreContainer", core); + MultiMapSolrParams mmsp = SolrRequestParsers.parseQueryString(hrequest.getQueryString()); + req = connector.request(mmsp); + + SolrQueryResponse rsp = connector.query(req); + + // prepare response + hresponse.setHeader("Cache-Control", "no-cache"); + HttpCacheHeaderUtil.checkHttpCachingVeto(rsp, hresponse, reqMethod); + + // check error + if (rsp.getException() != null) { + sendError(hresponse, rsp.getException()); + return; + } + + // write response header + final String contentType = responseWriter.getContentType(req, rsp); + if (null != contentType) response.setContentType(contentType); + + if (Method.HEAD == reqMethod) { + return; + } + + // write response body + if (responseWriter instanceof BinaryResponseWriter) { + ((BinaryResponseWriter) responseWriter).write(response.getOutputStream(), req, rsp); + } else { + out = new FastWriter(new OutputStreamWriter(response.getOutputStream(), UTF8.charset)); + responseWriter.write(out, req, rsp); + out.flush(); } - } - Map map = mmsp.getMap(); // get modifiable parameter map - // add default search field if missing (required by edismax) - if (!map.containsKey(CommonParams.DF)) map.put (CommonParams.DF, new String[]{CollectionSchema.text_t.getSolrFieldName()}); - // if this is a call to YaCys special search formats, enhance the query with field assignments - if ((responseWriter instanceof YJsonResponseWriter || responseWriter instanceof OpensearchResponseWriter) && "true".equals(mmsp.get("hl", "true"))) { - // add options for snippet generation - if (!map.containsKey("hl.q")) map.put("hl.q",new String[]{mmsp.get("q")}); - if (!map.containsKey("hl.fl")) map.put("hl.fl",new String[]{CollectionSchema.h1_txt.getSolrFieldName() + "," + CollectionSchema.h2_txt.getSolrFieldName() + "," + CollectionSchema.text_t.getSolrFieldName()}); - if (!map.containsKey("hl.alternateField")) map.put("hl.alternateField",new String[]{CollectionSchema.description_txt.getSolrFieldName()}); - if (!map.containsKey("hl.simple.pre")) map.put("hl.simple.pre",new String[]{""}); - if (!map.containsKey("hl.simple.post")) map.put("hl.simple.post",new String[]{""}); - if (!map.containsKey("hl.fragsize")) map.put("hl.fragsize",new String[]{Integer.toString(SearchEvent.SNIPPET_MAX_LENGTH)}); - } - SolrQueryRequest req = connector.request(mmsp); - SolrQueryResponse rsp = connector.query(req); - - // prepare response - hresponse.setHeader("Cache-Control", "no-cache"); - HttpCacheHeaderUtil.checkHttpCachingVeto(rsp, hresponse, reqMethod); - - // check error - if (rsp.getException() != null) { - sendError(hresponse, rsp.getException()); - return; - } - - // write response header - final String contentType = responseWriter.getContentType(req, rsp); - if (null != contentType) response.setContentType(contentType); - - if (Method.HEAD == reqMethod) { - return; - } - - // write response body - if (responseWriter instanceof BinaryResponseWriter) { - ((BinaryResponseWriter) responseWriter).write(response.getOutputStream(), req, rsp); - } else { - Writer out = new FastWriter(new OutputStreamWriter(response.getOutputStream(), UTF8.charset)); - responseWriter.write(out, req, rsp); - out.flush(); - } - - // log result - Object rv = rsp.getValues().get("response"); - int matches = 0; - if (rv != null && rv instanceof ResultContext) { - matches = ((ResultContext) rv).docs.matches(); - } else if (rv != null && rv instanceof SolrDocumentList) { - matches = (int) ((SolrDocumentList) rv).getNumFound(); - } - AccessTracker.addToDump(mmsp.get("q"), Integer.toString(matches)); - ConcurrentLog.info("SOLR Query", "results: " + matches + ", for query:" + req.getParamString()); - req.close(); - - SolrRequestInfo.clearRequestInfo(); - } - - private static void sendError(HttpServletResponse hresponse, Throwable ex) throws IOException { - int code = (ex instanceof SolrException) ? ((SolrException) ex).code() : 500; - StringWriter sw = new StringWriter(); - ex.printStackTrace(new PrintWriter(sw)); - hresponse.sendError((code < 100) ? 500 : code, ex.getMessage() + "\n\n" + sw.toString()); - } - - public static void waitForSolr(String context, int port) throws Exception { - // A raw term query type doesn't check the schema - URL url = new URL("http://127.0.0.1:" + port + context + "/select?q={!raw+f=test_query}ping"); - - Exception ex=null; - // Wait for a total of 20 seconds: 100 tries, 200 milliseconds each - for (int i = 0; i < 600; i++) { - try { - InputStream stream = url.openStream(); - stream.close(); - } catch (final IOException e) { - ex=e; - Thread.sleep(200); - continue; - } - return; - } - throw new RuntimeException("Jetty/Solr unresponsive", ex); - } - - public static class Servlet404 extends HttpServlet { - private static final long serialVersionUID=-4497069674942245148L; - @Override - public void service(HttpServletRequest req, HttpServletResponse res) throws IOException { - res.sendError(HttpServletResponse.SC_NOT_FOUND, "Can not find: " + req.getRequestURI()); - } - } - -} + + //debug + @SuppressWarnings("unchecked") + Iterator> ie = rsp.getValues().iterator(); + Map.Entry e; + while (ie.hasNext()) { + e = ie.next(); + System.out.println("Field: " + e.getKey() + ", value: " + e.getValue().getClass().getName()); + //Field: responseHeader, value: org.apache.solr.common.util.SimpleOrderedMap + //Field: response, value: org.apache.solr.search.DocSlice + if (e.getValue() instanceof DocList) { + DocList ids = (DocList) e.getValue(); + SolrIndexSearcher searcher = req.getSearcher(); + DocIterator iterator = ids.iterator(); + int sz = ids.size(); + for (int i = 0; i < sz; i++) { + int id = iterator.nextDoc(); + searcher.doc(id); + } + } + } + + responseWriter.write(out, req, rsp); + out.flush(); + } catch (final Throwable ex) { + sendError(hresponse, ex); + } finally { + if (req != null) { + req.close(); + } + SolrRequestInfo.clearRequestInfo(); + if (out != null) try {out.close();} catch (final IOException e1) {} + } + } + + private static void sendError(HttpServletResponse hresponse, Throwable ex) throws IOException { + int code = (ex instanceof SolrException) ? ((SolrException) ex).code() : 500; + StringWriter sw = new StringWriter(); + ex.printStackTrace(new PrintWriter(sw)); + hresponse.sendError((code < 100) ? 500 : code, ex.getMessage() + "\n\n" + sw.toString()); + } + + public static void waitForSolr(String context, int port) throws Exception { + // A raw term query type doesn't check the schema + URL url = new URL("http://127.0.0.1:" + port + context + "/select?q={!raw+f=test_query}ping"); + + Exception ex=null; + // Wait for a total of 20 seconds: 100 tries, 200 milliseconds each + for (int i = 0; i < 600; i++) { + try { + InputStream stream = url.openStream(); + stream.close(); + } catch (final IOException e) { + ex=e; + Thread.sleep(200); + continue; + } + return; + } + throw new RuntimeException("Jetty/Solr unresponsive", ex); + } + + public static class Servlet404 extends HttpServlet { + private static final long serialVersionUID=-4497069674942245148L; + @Override + public void service(HttpServletRequest req, HttpServletResponse res) throws IOException { + res.sendError(404, "Can not find: " + req.getRequestURI()); + } + } + +} diff --git a/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java index f08f87acf..036204fbe 100644 --- a/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java +++ b/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java @@ -316,7 +316,9 @@ public abstract class AbstractSolrConnector implements SolrConnector { final SolrQuery query = new SolrQuery(); assert id.length() == 12; // construct query - query.setQuery("{!raw f=" + CollectionSchema.id.getSolrFieldName() + "}" + id); + StringBuilder sb = new StringBuilder(23); + sb.append("{!raw f=").append(CollectionSchema.id.getSolrFieldName()).append('}').append(id); + query.setQuery(sb.toString()); query.clearSorts(); query.setRows(1); query.setStart(0); diff --git a/source/net/yacy/document/content/SurrogateReader.java b/source/net/yacy/document/content/SurrogateReader.java index 3e0199d25..4eb01e07b 100644 --- a/source/net/yacy/document/content/SurrogateReader.java +++ b/source/net/yacy/document/content/SurrogateReader.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; +import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.zip.GZIPInputStream; @@ -140,7 +141,7 @@ public class SurrogateReader extends DefaultHandler implements Runnable { } else if ("value".equals(tag)) { this.buffer.setLength(0); this.parsingValue = true; - } else if (tag.startsWith("dc:") || tag.startsWith("geo:")) { + } else if (tag.startsWith("dc:") || tag.startsWith("geo:") || tag.startsWith("md:")) { // parse dublin core attribute this.elementName = tag; this.parsingValue = true; @@ -173,15 +174,18 @@ public class SurrogateReader extends DefaultHandler implements Runnable { } this.buffer.setLength(0); this.parsingValue = false; - } else if (tag.startsWith("dc:") || tag.startsWith("geo:")) { + } else if (tag.startsWith("dc:") || tag.startsWith("geo:") || tag.startsWith("md:")) { final String value = buffer.toString().trim(); if (this.elementName != null && tag.equals(this.elementName)) { - value.replaceAll(";", ","); - String oldcontent = this.surrogate.get(this.elementName); - if (oldcontent == null) { - this.surrogate.getMap().put(this.elementName, new String[]{value}); + Map map = this.surrogate.getMap(); + String[] oldcontent = map.get(this.elementName); + if (oldcontent == null || oldcontent.length == 0) { + map.put(this.elementName, new String[]{value}); } else { - this.surrogate.getMap().put(this.elementName, new String[]{oldcontent + ";" + value}); + String[] newcontent = new String[oldcontent.length + 1]; + System.arraycopy(oldcontent, 0, newcontent, 0, oldcontent.length); + newcontent[oldcontent.length] = value; + map.put(this.elementName, newcontent); } } this.buffer.setLength(0); diff --git a/source/net/yacy/http/GSAsearchServlet.java b/source/net/yacy/http/GSAsearchServlet.java index c0730680a..9e5b76b86 100644 --- a/source/net/yacy/http/GSAsearchServlet.java +++ b/source/net/yacy/http/GSAsearchServlet.java @@ -64,6 +64,8 @@ import org.apache.solr.util.FastWriter; */ public class GSAsearchServlet extends HttpServlet { + private static final long serialVersionUID = 7835985518515673885L; + private final static GSAResponseWriter responseWriter = new GSAResponseWriter(); @Override diff --git a/source/net/yacy/search/index/Fulltext.java b/source/net/yacy/search/index/Fulltext.java index 512772a52..0e2079feb 100644 --- a/source/net/yacy/search/index/Fulltext.java +++ b/source/net/yacy/search/index/Fulltext.java @@ -84,8 +84,8 @@ import org.apache.lucene.util.Version; public final class Fulltext { - private static final String SOLR_PATH = "solr_45"; // the number should be identical to the number in the property luceneMatchVersion in solrconfig.xml - private static final String SOLR_OLD_PATH[] = new String[]{"solr_36", "solr_40", "solr_44"}; + private static final String SOLR_PATH = "solr_46"; // the number should be identical to the number in the property luceneMatchVersion in solrconfig.xml + private static final String SOLR_OLD_PATH[] = new String[]{"solr_36", "solr_40", "solr_44", "solr_45"}; // class objects private final File segmentPath; diff --git a/source/net/yacy/search/query/QueryModifier.java b/source/net/yacy/search/query/QueryModifier.java index 9908f8646..362ece108 100644 --- a/source/net/yacy/search/query/QueryModifier.java +++ b/source/net/yacy/search/query/QueryModifier.java @@ -23,6 +23,7 @@ package net.yacy.search.query; import java.util.ArrayList; import org.apache.solr.common.params.CommonParams; +import org.apache.solr.common.params.MultiMapSolrParams; import net.yacy.cora.document.id.DigestURL; import net.yacy.cora.util.CommonPattern; @@ -148,10 +149,11 @@ public class QueryModifier { public String toString() { return this.modifier.toString(); } + - public void apply(serverObjects post) { + private StringBuilder apply(String FQ) { - final StringBuilder fq = new StringBuilder(post.get(CommonParams.FQ,"")); + final StringBuilder fq = new StringBuilder(FQ); if (this.sitehost != null && this.sitehost.length() > 0 && fq.indexOf(CollectionSchema.host_s.getSolrFieldName()) < 0) { // consider to search for hosts with 'www'-prefix, if not already part of the host name @@ -179,6 +181,12 @@ public class QueryModifier { fq.append(" AND ").append(CollectionSchema.url_protocol_s.getSolrFieldName()).append(":\"").append(this.protocol).append('\"'); } + return fq; + } + public void apply(serverObjects post) { + + final StringBuilder fq = apply(post.get(CommonParams.FQ,"")); + if (fq.length() > 0) { String fqs = fq.toString(); if (fqs.startsWith(" AND ")) fqs = fqs.substring(5); @@ -186,6 +194,18 @@ public class QueryModifier { post.put(CommonParams.FQ, fqs); } } + + public void apply(MultiMapSolrParams mmsp) { + + final StringBuilder fq = apply(mmsp.get(CommonParams.FQ,"")); + + if (fq.length() > 0) { + String fqs = fq.toString(); + if (fqs.startsWith(" AND ")) fqs = fqs.substring(5); + mmsp.getMap().remove(CommonParams.FQ); + mmsp.getMap().put(CommonParams.FQ, new String[]{fqs}); + } + } /** * parse a GSA site description string and create a filter query string diff --git a/source/net/yacy/search/schema/CollectionConfiguration.java b/source/net/yacy/search/schema/CollectionConfiguration.java index 9e98b5487..c6eef588c 100644 --- a/source/net/yacy/search/schema/CollectionConfiguration.java +++ b/source/net/yacy/search/schema/CollectionConfiguration.java @@ -70,6 +70,7 @@ import net.yacy.crawler.retrieval.Response; import net.yacy.document.Condenser; import net.yacy.document.Document; import net.yacy.document.SentenceReader; +import net.yacy.document.content.DCEntry; import net.yacy.document.parser.html.ContentScraper; import net.yacy.document.parser.html.ImageEntry; import net.yacy.kelondro.data.citation.CitationReference; @@ -788,6 +789,22 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri add(doc, CollectionSchema.publisher_url_s, html.getPublisherLink().toNormalform(true)); } } + + if (parser instanceof DCEntry) { + // the document was created with a surrogate parsing; overwrite all md: -entries to Solr + DCEntry dcentry = (DCEntry) parser; + for (Map.Entry entry: dcentry.getMap().entrySet()) { + String tag = entry.getKey(); + if (!tag.startsWith("md:") || tag.length() < 4) continue; + CollectionSchema solr_field = CollectionSchema.valueOf(tag.substring(3)); + if (solr_field == null) continue; + String[] values = entry.getValue(); + if (values == null || values.length == 0) continue; + if (allAttr || contains(solr_field)) { + add(doc, solr_field, values); + } + } + } String content = document.getTextString(); String tokens = digestURL.toTokens(); diff --git a/source/net/yacy/server/serverObjects.java b/source/net/yacy/server/serverObjects.java index 3937303f0..c7836e045 100644 --- a/source/net/yacy/server/serverObjects.java +++ b/source/net/yacy/server/serverObjects.java @@ -70,7 +70,6 @@ import net.yacy.search.schema.CollectionSchema; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.params.MultiMapSolrParams; -import org.apache.solr.common.params.SolrParams; public class serverObjects implements Serializable, Cloneable { @@ -544,7 +543,7 @@ public class serverObjects implements Serializable, Cloneable { return param.toString(); } - public SolrParams toSolrParams(CollectionSchema[] facets) { + public MultiMapSolrParams toSolrParams(CollectionSchema[] facets) { // check if all required post fields are there if (!this.containsKey(CommonParams.DF)) this.put(CommonParams.DF, CollectionSchema.text_t.getSolrFieldName()); // set default field to the text field if (!this.containsKey(CommonParams.START)) this.put(CommonParams.START, "0"); // set default start item diff --git a/startYACY.sh b/startYACY.sh index 7d3c6508d..ef59f49bf 100755 --- a/startYACY.sh +++ b/startYACY.sh @@ -19,13 +19,7 @@ else ID="id" fi -if [ "`$ID -u`" -eq 0 ] -then - echo - echo "For security reasons you should not run this script as root!" - echo - exit 1 -elif [ ! -x "$JAVA" ] +if [ ! -x "$JAVA" ] then echo "The java command is not executable." echo "Either you have not installed java or it is not in your PATH" @@ -139,7 +133,7 @@ then fi #turn on MMap for Solr if OS is a 64bit OS -if [ -n "`uname -m | grep 64`" ]; then JAVA_ARGS="$JAVA_ARGS -Dsolr.directoryFactory=solr.MMapDirectoryFactory"; fi +if [ -n "`uname -m | grep 64`" ]; then JAVA_ARGS="$JAVA_ARGS -d64 -Dsolr.directoryFactory=solr.MMapDirectoryFactory"; fi if [ ! -f $CONFIGFILE -a -f DATA/SETTINGS/httpProxy.conf ] then