From 1af0e9ef74cde197a52a33c7c8f042a496b08812 Mon Sep 17 00:00:00 2001 From: reger Date: Sun, 3 Jan 2016 01:11:27 +0100 Subject: [PATCH] remove workaround for Solr bug regarding multivalued date fields fixed in 5.4.0 http://issues.apache.org/jira/browse/SOLR-8050 --- source/net/yacy/search/Switchboard.java | 4 ++++ .../federate/solr/connector/EmbeddedSolrConnectorTest.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index 8d5d6c837..7596892b8 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -2512,11 +2512,15 @@ public final class Switchboard extends serverSwitch { // 2015-09-12 Solr v5.2.1 & v5.3 // this hack switches partial update off (if multivalued datefield _dts exists, like: dates_in_content_dts startDates_dts endDates_dts) boolean partialUpdate = getConfigBool("postprocessing.partialUpdate", true); + + /* Solr 5.4.0 bugfix see http://issues.apache.org/jira/browse/SOLR-8050 Partial update on document with multivalued date field fails + * for (String sf : index.fulltext().getDefaultConfiguration().keySet()) { if (sf.endsWith("_dts")) { partialUpdate = false; } } + */ if (allCrawlsFinished) { // refresh the search cache SearchEventCache.cleanupEvents(true); diff --git a/test/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnectorTest.java b/test/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnectorTest.java index 78c49bf4d..ff4411622 100644 --- a/test/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnectorTest.java +++ b/test/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnectorTest.java @@ -121,6 +121,8 @@ public class EmbeddedSolrConnectorTest { * Test for partial update for document containing a multivalued date field * this is a Solr issue (2015-09-12) * the test case is just to demonstrate the effect on YaCy (currently catching the solr exception and reinserting a document with fields missing) + * + * Solr 5.4.0 bugfix @see http://issues.apache.org/jira/browse/SOLR-8050 Partial update on document with multivalued date field fails */ @Test public void testUdate_withMultivaluedDateField() throws SolrException, IOException { @@ -142,7 +144,7 @@ public class EmbeddedSolrConnectorTest { fieldnames.addAll(doc.getFieldNames()); SolrInputDocument sid = new SolrInputDocument(); - sid.addField(CollectionSchema.id.name(), doc.getFieldValue(CollectionSchema.id.name())); + sid.addField(CollectionSchema.id.name(), id); sid.addField(CollectionSchema.host_s.name(), "yacy.yacy"); solr.update(sid); solr.commit(true);