Revision 34448
Added by Alessia Bardi over 9 years ago
DnetLoggerMongoDao.java | ||
---|---|---|
31 | 31 |
@Override |
32 | 32 |
public void configureIndex(final String collection, final Map<String, IndexConf> conf) { |
33 | 33 |
final DBCollection coll = db.getCollection(collection); |
34 |
coll.resetIndexCache();
|
|
34 |
coll.dropIndexes();
|
|
35 | 35 |
|
36 | 36 |
for (String key : conf.keySet()) { |
37 |
coll.ensureIndex(key);
|
|
37 |
coll.createIndex(new BasicDBObject(key, 1));
|
|
38 | 38 |
} |
39 | 39 |
} |
40 | 40 |
|
... | ... | |
80 | 80 |
} |
81 | 81 |
|
82 | 82 |
@Override |
83 |
public Iterator<Map<String, String>> find(final String collection, final Map<String, String> criteria) {
|
|
83 |
public Iterator<Map<String, String>> find(final String collection, final Map<String, Object> criteria) {
|
|
84 | 84 |
final DBCollection coll = db.getCollection(collection); |
85 | 85 |
return iter(collection, coll.find(new BasicDBObject(criteria))); |
86 | 86 |
} |
... | ... | |
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
@Override |
106 |
public Iterator<Map<String, String>> findByDateRange(final String collection, final Date startDate, final Date endDate, final Map<String, String> criteria) {
|
|
106 |
public Iterator<Map<String, String>> findByDateRange(final String collection, final Date startDate, final Date endDate, final Map<String, Object> criteria) {
|
|
107 | 107 |
final DBCollection coll = db.getCollection(collection); |
108 | 108 |
final DBObject dateQuery = dateRangeQuery(startDate, endDate); |
109 | 109 |
final BasicDBObject customQuery = new BasicDBObject(criteria); |
Also available in: Unified diff
Query criteria as Map<String,Object> in order to support the query to get the stats report for the stats ui.