Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverting source_file_path back to value it was in 3.2. #313

Merged
merged 6 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

**NOTE** Generally, we only add terms to the Solr schema, so it should usually be compatible with previous versions (i.e. clients should be able to query across both without modification). However, there are been a small number of fixes which unfortunately required breaking changes you may need to be aware of or work-around. e.g. [hash becomes single-valued](https://github.com/ukwa/webarchive-discovery/issues/95)... TBA...

3.3.1
-----
(UNRELEASED)

source_file and source_file_path are again set correct as there were in version 3.2.0.

3.3.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ private void processEnvelopeHeader(SolrRecord solr, ArchiveRecordHeader header,

//Will convert windows path to linux path. Linux paths will not be modified.
final String linuxFilePath = FilenameUtils.separatorsToUnix(filePath);
solr.setField(SolrFields.SOURCE_FILE, linuxFilePath);
solr.setField(SolrFields.SOURCE_FILE_PATH, linuxFilePath);

byte[] url_md5digest = md5
.digest(Normalisation.sanitiseWARCHeaderValue(header.getUrl()).getBytes(StandardCharsets.UTF_8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ public static void parseWarcFiles( WARCIndexerCommandOptions opts, boolean isTex
recordCount++;
}
} else {
log.info("No document produced by record: " + type + " for url " + url + " from " +
inFile.getName() + " @" + rec.getHeader().getOffset());
log.debug("No document produced by record: " + type + " for url " + url + " from " +
inFile.getName() + " @" + rec.getHeader().getOffset()); //All request records will log this. It is expected there is no document.
}
}
docConsumer.endWARC();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -61,6 +62,7 @@
import uk.bl.wa.annotation.Annotations;
import uk.bl.wa.annotation.AnnotationsTest;
import uk.bl.wa.annotation.Annotator;
import uk.bl.wa.solr.SolrFields;
import uk.bl.wa.solr.SolrRecord;
import uk.bl.wa.util.Normalisation;

Expand Down Expand Up @@ -191,6 +193,12 @@ public void testEmbeddedServer() throws SolrServerException, IOException, NoSuch
}
assertEquals(21L, response.getResults().getNumFound());

//Test source_file and source_file_path
SolrDocument doc = response.getResults().get(0);
assertEquals(doc.getFieldValue(SolrFields.SOURCE_FILE),"flashfrozen-jwat-recompressed.warc.gz");
String source_file_path = (String) doc.getFieldValue(SolrFields.SOURCE_FILE_PATH);
assertTrue(source_file_path.endsWith("wikipedia-mona-lisa/flashfrozen-jwat-recompressed.warc.gz")); //First path of path depend on project location.

}

}
Loading