Which type should I use in C# for fields of type "LatLonType"?

19 views
Skip to first unread message

Jose Antonio Caravaca Diosdado

unread,
Aug 2, 2017, 3:08:47 PM8/2/17
to SolrNet
Hi,

I have an schema.xml with the following fields:

<field name="intId" type="tint" indexed="true" stored="true" required="true" multiValued="false" />
<field name="geoLatLon" type="LatLonType" indexed="true" stored="true" required="true" multiValued="false" />

In my solution I have a class with the same attributes, but I don't know which type I should use for the field "geoLatLon":

class Location
{
     [SolrField("intId")]
     public int id { get; set; }

     [SolrField("geoLatLon")]
     public ??? latlon{ get; set; }
}

I would like to know it in order to add documents in a easy way.

ISolrOperations<Location> solr = ServiceLocator.Current.GetInstance<ISolrOperations<Location>>();
Location location = new Location();
location.latlon= ???;
solr.Add(location);

I'm using SolrNet 0.4 and Solr 5.5.3

pascal.s...@geo.scout24.ch

unread,
Jan 23, 2018, 8:51:48 AM1/23/18
to SolrNet
Hi

I use a string and populate it like this: 

latlon = address.Latitude + "," + address.Longitude;

address.Latitude and address.Longitude are of type decimal in my case but double would also work as far as I know.
Reply all
Reply to author
Forward
0 new messages