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

Fix issue with duplicate field for WaPo in Solr. #807

Merged
merged 2 commits into from
Sep 16, 2019
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions src/main/java/io/anserini/index/IndexCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ public void run() {
if (field.fieldType().docValuesType() != DocValuesType.NONE) {
continue;
}
// If the field is already in the doc, skip it.
// This fixes an issue with WaPo where published_date is in the Lucene doc as LongPoint and StoredField. Solr needs one copy, more fine-grained control in config.
if (solrDocument.containsKey(field.name())) {
continue;
}
if (field.stringValue() != null) { // For some reason, id is multi-valued with null as one of the values
solrDocument.addField(field.name(), field.stringValue());
} else if (field.numericValue() != null) {
Expand Down