Skip to content

Commit

Permalink
remove workaround for Solr bug regarding multivalued date fields
Browse files Browse the repository at this point in the history
  • Loading branch information
reger committed Jan 3, 2016
1 parent 5a35f93 commit 1af0e9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions source/net/yacy/search/Switchboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -2512,11 +2512,15 @@ && getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").isEmpty() ) {
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public void testUdate() throws IOException {
* 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 {
Expand All @@ -142,7 +144,7 @@ public void testUdate_withMultivaluedDateField() throws SolrException, IOExcepti
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);
Expand Down

0 comments on commit 1af0e9e

Please sign in to comment.