Skip to content

Apache Lucene open-source search software

LUCENE-2728: fix id handling in EnwikiContentSource

Grant Ingersolldd42b928c7ad
diff --git a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java
index 71d066c7e60..93d2e52621a 100644
--- a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java
+++ b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/EnwikiContentSource.java
@@ -152,7 +152,10 @@ public class EnwikiContentSource extends ContentSource {
title = contents.toString();
break;
case ID:
- id = contents.toString();
+ //the doc id is the first one in the page. All other ids after that one can be ignored according to the schema
+ if (id == null) {
+ id = contents.toString();
+ }
break;
default:
// this element should be discarded.