public void SearchDocumentsTest() { var locationData = new LocationData(ConfigurationManager.AppSettings[ConfigurationKeys.BingMapsKey]); var searchServiceName = ConfigurationManager.AppSettings[ConfigurationKeys.SearchServiceName]; var searchServiceKey = ConfigurationManager.AppSettings[ConfigurationKeys.SearchServiceKey]; var searchClient = new SearchDocument(searchServiceName, searchServiceKey); var data = locationData.GetBoundingBoxCoordinates("Delhi,India").Result; var searchResult = searchClient.SearchDocuments <GpsSensorRecord>("*", SearchDocument.FilterTextForLocationBounds("geoCoordinates", data)); var locationPoint = new LocationPoint { Latitude = 28.644979476928711, Longitude = 77.2164306640625 }; var searchByDistance = searchClient.SearchDocuments <GpsSensorRecord>("*", SearchDocument.FilterTextForDistanceFromPoint("geoCoordinates", locationPoint, 100)); Assert.IsTrue(searchResult.Any()); Assert.IsTrue(searchByDistance.Any()); var dataUsa = locationData.GetBoundingBoxCoordinates("Washington,USA").Result; var searchResultUsa = searchClient.SearchDocuments <GpsSensorRecord>("*", SearchDocument.FilterTextForLocationBounds("geoCoordinates", dataUsa)); Assert.IsTrue(searchResultUsa.Any()); }