I have a Spring Boot
Application and I am trying to store data directly to Solr. Following is my Solr Model class
public class AnalyticsGeoLocationSolr {
@Id
@Indexed(name = "id", type = "int")
private Integer id;
@Indexed(name = "ipaddress", type = "string") // defined as String
private String ipAddress;
@Indexed(name = "country_name", type = "string") // defined as String
private String countryName;
// Getters and Setters
Here you can see that ipAddress
and CountryName
both are defined as String
as type="string"
. However, the Solr is saving these variables as an array of String
. Following is display of these fields in Solr
(as Json
):
"ipAddress":["59.103.217.207"],
"countryName":["Pakistan"],
// Other fields
Now, I want these String Objects to be stored as string i.e the expected Output should be "ipAddress":"59.103.217.207" not an array (with [ ] around).