Revision 44513
Added by Alessia Bardi about 8 years ago
modules/dnet-oai-store-service/branches/nodeRefactoring/src/main/java/eu/dnetlib/data/oai/store/mongo/MongoPublisherStore.java | ||
---|---|---|
47 | 47 |
import org.apache.commons.logging.LogFactory; |
48 | 48 |
import org.bson.conversions.Bson; |
49 | 49 |
import org.bson.types.Binary; |
50 |
import org.z3950.zing.cql.CQLParseException; |
|
51 | 50 |
|
52 | 51 |
public class MongoPublisherStore implements PublisherStore<DNetOAIMongoCursor> { |
53 | 52 |
|
... | ... | |
188 | 187 |
Stopwatch sw = Stopwatch.createUnstarted(); |
189 | 188 |
sw.start(); |
190 | 189 |
// I want to keep the composite indexes that might have been defined manually |
191 |
log.debug("Ensuring currently defined composite indexes on store "+id+": "); |
|
190 |
// I DO NOT NEED TO DO THIS. If the indexes are there, they are there. |
|
191 |
/*log.debug("Ensuring currently defined composite indexes on store "+id+": "); |
|
192 | 192 |
for (BasicDBObject o : indexesIterable) { |
193 | 193 |
BasicDBObject fieldIndexed = (BasicDBObject) o.get("key"); |
194 | 194 |
if (fieldIndexed.keySet().size() > 1) { |
195 | 195 |
log.debug(o); |
196 | 196 |
this.collection.createIndex(fieldIndexed, indexOptions); |
197 | 197 |
} |
198 |
} |
|
198 |
}*/
|
|
199 | 199 |
// Indexes on single fields. |
200 | 200 |
for (PublisherField field : this.mongoFields) { |
201 | 201 |
BasicDBObject mongoIdx = new BasicDBObject(field.getFieldName(), 1); |
... | ... | |
380 | 380 |
*/ |
381 | 381 |
private boolean feedRecord(final String record, final String source, final Date feedDate, final MongoCollection<DBObject> unackCollection) { |
382 | 382 |
PublisherRecordParser parser = new PublisherRecordParser(this.mongoFields); |
383 |
final Multimap<String, String> recordProperties = parser.parseRecord(record); |
|
383 |
final Multimap<String, String> recordProperties = parser.parseRecord(record, source);
|
|
384 | 384 |
String id = ""; |
385 | 385 |
String oaiID = ""; |
386 | 386 |
if (recordProperties.containsKey(OAIConfigurationReader.ID_FIELD)) { |
Also available in: Unified diff
put the source into the record properties