Revision 44824
Added by Sandro La Bruzzo over 7 years ago
modules/dnet-data-provision-services/trunk/src/main/java/eu/dnetlib/index/actors/IndexFeedActorImpl.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.index.actors; |
2 | 2 |
|
3 | 3 |
import java.io.IOException; |
4 |
import java.util.Date; |
|
4 | 5 |
import java.util.concurrent.ExecutorService; |
5 | 6 |
import java.util.concurrent.Executors; |
6 | 7 |
import java.util.function.Function; |
... | ... | |
83 | 84 |
|
84 | 85 |
final IndexServerDAO serverDAO = indexServerDAOMap.getIndexServerDAO(backendId); |
85 | 86 |
final DocumentMapperFactory docMapperFactory = serverDAO.getDocumentMapperFactory(); |
86 |
final String version = DateUtils.now_ISO8601();
|
|
87 |
final Function<String, IndexDocument> docMapper = docMapperFactory.getRecordMapper(serverDAO.getSchema(mdref), mdref, dsId, version, emptyResult);
|
|
87 |
final String version = DateUtils.getParsedDateField(DateUtils.now_ISO8601());
|
|
88 |
final Function<String, IndexDocument> docMapper = docMapperFactory.getRecordMapper(serverDAO.getSchema(mdref), mdref, dsId, version, emptyResult);
|
|
88 | 89 |
|
89 | 90 |
Iterable<IndexDocument> result = DnetStreamSupport.generateStreamFromIterator(docIterator.iterator()).map(docMapper)::iterator; |
90 | 91 |
|
... | ... | |
120 | 121 |
* @throws IndexServiceException the index service exception |
121 | 122 |
*/ |
122 | 123 |
private void deleteByVersion(final IndexCollection indexCollection, final String dsId, final String version) throws IndexServiceException { |
123 |
final String query = String.format("%s:[* TO %s}", IndexFieldUtility.DS_VERSION, version);
|
|
124 |
indexCollection.deleteByQuery(query, dsId);
|
|
124 |
final String query = String.format("%s:[* TO \"%s\"}", IndexFieldUtility.DS_VERSION, version);
|
|
125 |
indexCollection.deleteByQuery(query, dsId);
|
|
125 | 126 |
} |
126 | 127 |
|
127 | 128 |
/** |
Also available in: Unified diff
fixed feed indexing action updated the deletebyquery