Adding Geocode Fields
While setting the properties for fields, you may also add special fields such as geo-codes. Right click in the field list and "Add Geocode". A dialog will be shown to allow you to choose two fields, one each for latitude and longitude. Only fields of numeric data types are given as choices for these fields. The alias given to the new geocode field will determine how to query the engine.
Implementation
You can use this field type to make a composite field addressable in a coordinate system. You may have a latitude/longitude coordinate pair for your listing object, zip code, users, etc. With this you can create a geocode field and address it from the API as a single field. This is a great improvement over standard SQL since you can query based on a comparer (LT, GT, EQ) and radius (in miles). Now you have have the power to retrieve objects based on a coordinate system.
Add BinaryNull/BinaryMap fields
There are times when you need special fields. Two such fields are the BinaryNull and BinaryMap fields. The first allows you to map a nullable database field to a binary value. This might be used for sorting when you want nulls to show up above or below other results and do not care about the non-null values. In other words, the sort will be defined by null and not null not the actual field values.
The BinaryMap field is similar in that it creates a boolean field out of a database column. You defined the value you wish to be mapped to true. All other database values map to false. This allows you to treat the column as a boolean value no matter the values of the original database column.
Implementation
The above fields may not seem intuitive to use. You may ask what use are they at all. A useful implementation might be sorting. If you define a BinaryNull field and allow sorting on it, you can define a sort where all null values are at the top and all other values follow in no order. You cannot do this in standard SQL. If you sort by a nullable field, nulls will be grouped together but all other values will be sorted too. You may define a double sort by widget type and date where widget type is nullable. In a standard sort all widget types of type null will be at the top and then other types will follow sorted, i.e. 1, 3, 4, 7, 9, etc. Within each of these groups the items will be sorted by date. With a BinaryNull field you can have all widget types with a null value sorted by date (group 1) and then all non-null widget types sorted by date (group 2).
The BinaryMap field plays much the same role except that it allows you to map a specific field value to True and all other values are False. Now you can run queries and more importantly sorts on the field and get two groups instead of N-number of groups.





