Revision 57157
Added by Enrico Ottonello over 4 years ago
AnySolrUtil.java | ||
---|---|---|
3 | 3 |
import java.util.Iterator; |
4 | 4 |
import java.util.Map.Entry; |
5 | 5 |
|
6 |
import org.apache.solr.common.SolrDocumentList; |
|
7 |
import org.apache.solr.common.util.NamedList; |
|
8 |
|
|
6 | 9 |
import eu.dnetlib.clients.index.model.AnyMap; |
7 | 10 |
import eu.dnetlib.clients.index.model.DataFactory; |
8 | 11 |
import eu.dnetlib.clients.index.model.InvalidValueTypeException; |
9 | 12 |
import eu.dnetlib.clients.index.model.Value; |
10 | 13 |
import eu.dnetlib.clients.index.model.impl.DefaultDataFactoryImpl; |
11 | 14 |
import eu.dnetlib.clients.index.model.util.AnyUtil; |
12 |
import org.apache.solr.common.SolrDocumentList; |
|
13 |
import org.apache.solr.common.util.NamedList; |
|
14 | 15 |
|
15 | 16 |
/** |
16 | 17 |
* The Class AnySolrUtil. |
... | ... | |
19 | 20 |
|
20 | 21 |
/** |
21 | 22 |
* Convert named list to any map. |
22 |
* |
|
23 |
* @param list the list |
|
24 |
* @param map the map |
|
23 |
* |
|
24 |
* @param list |
|
25 |
* the list |
|
26 |
* @param map |
|
27 |
* the map |
|
25 | 28 |
* @return the any map |
26 | 29 |
*/ |
27 | 30 |
@SuppressWarnings("unchecked") |
... | ... | |
47 | 50 |
final Value value = DataFactory.DEFAULT.autoConvertValue(obj); |
48 | 51 |
map.put(key, value); |
49 | 52 |
} catch (InvalidValueTypeException exception) { |
50 |
|
|
53 |
; // skip |
|
51 | 54 |
} |
52 | 55 |
} |
53 | 56 |
} |
... | ... | |
56 | 59 |
|
57 | 60 |
/** |
58 | 61 |
* Convert named list to any map. |
59 |
* |
|
60 |
* @param list the list |
|
62 |
* |
|
63 |
* @param list |
|
64 |
* the list |
|
61 | 65 |
* @return the any map |
62 | 66 |
*/ |
63 | 67 |
public static AnyMap convertNamedListToAnyMap(final NamedList<Object> list) { |
Also available in: Unified diff
solr 772 integration