Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
4.0
-
None
-
None
Description
The SolrJ DocumentObjectBinder class does not retain order when reading in dynamic field values into a Map. More specifically, the order in which the Map is populated by an application is different to the order in which the Map is repopulated by SolrJ.
@Field("dynamic_field_values*")
private Map<String, Object> dynamicFieldValuesMap = new LinkedHashMap<String, Object>(16);
I believe the following would address this issue.
– allValuesMap = new HashMap<String, Object>();
+ allValuesMap = new LinkedHashMap<String, Object>();
Or, maybe the DocumentObjectBinder should directly populate the Map field directly if that field is not null.
----------------
I am pretty sure issue does NOT exist with dynamic field values in a List, as the SolrJ DocumentObjectBinder uses a List implementation that retains ordering "new ArrayList();". So the following will retain ordering.
@Field("dynamic_field_values_ss")
private List<String> dynamicFieldValues = new ArrayList<String>();