I have my schema set up with the following node....
<field name="LocationCoordinates" type="location" indexed="true" stored="true" />
... and my class has the following property....
[SolrField("LocationCoordinates")]
public string LocationCoordinates
{
get
{
if (LocationZipCodeLat.HasValue && LocationZipCodeLon.HasValue)
{
var retval = LocationZipCodeLat.ToString() + "," + LocationZipCodeLon.ToString();
return retval;
}
return ",";
}
}
When LocationZipCodeLat and LocationZipCodeLon have a value I am able to add a document to my solr index. However, when it gets to the else part which returns "," I get the following error in my log.
SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=827592] Error adding field 'LocationCoordinates'=','
at org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:333)
I've tried returning string.Empty also but I get the same error. So, when I have an object without a location, what do I return from this property to be able to add the document? Thanks.