Revision 30114
Added by Sandro La Bruzzo over 9 years ago
SolrResponseParser.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import static eu.dnetlib.miscutils.collections.MappedCollection.listMap; |
4 | 4 |
|
5 |
import java.util.ArrayList; |
|
6 | 5 |
import java.util.Collection; |
7 | 6 |
import java.util.List; |
8 | 7 |
import java.util.Map; |
... | ... | |
304 | 303 |
@SuppressWarnings("unchecked") |
305 | 304 |
protected String getSingleField(final SolrDocument doc, final String fieldName) { |
306 | 305 |
Object value = doc.getFieldValue(fieldName); |
307 |
ArrayList<String> docs = (ArrayList<String>) value; |
|
308 |
docs.get(0); |
|
309 | 306 |
if (value instanceof Collection) return Iterables.getOnlyElement((Iterable<String>) value); |
310 | 307 |
return String.valueOf(value); |
311 | 308 |
} |
Also available in: Unified diff
created parameter for DNET_RESULT field for InputDocumentMapper Factory