Let's say I'm building a restaurant review application (e.g. Yelp)
using SQL Server 2005 and NHibernate.  I want to allow users to search
for restaurants by keywords and/or proximity to their current
location.  The keyword search will use the SQL Server 2005 full text
search CONTAINS function, while the distance calculation will be done
using a stored procedure that can calculate the distance between two
lat/long points.

For the sake of simplicity, let's say I have a table called
Restaurants with the following columns:

RestaurantId int
RestaurantName nvarchar(100)
Latitude float
Longitude float

What's the best way to construct this query?

A few requirements:
1.  Users can specify keywords or location or both or neither
2.  The end result needs to be ranked by distance, then relevance
3.  Resulting IList (or whatever we're returning) needs to have
Restaurant information as well as the distance in it for displaying
purposes.  I'm assuming we need to create a new class just to handle
the search results (e.g. RestaurantSearchResult which holds both a
Restaurant instance and a Distance property)?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to