Raven DB Spacial search problem(pickle)

29 views
Skip to first unread message

Jim Baltika

unread,
Mar 14, 2012, 11:42:53 AM3/14/12
to rav...@googlegroups.com
Hi,
I am looking for advice how better utilize Raven & Lucene Spacial. There is real case. The clinician a.k.a doctor can be 1+ location and i need to search by radius asc primarily plus specialty plus other features. Any suggestions?

Thanks in advance Jim


The simple one location lat & lng search is no brainier.
this.Map = documents => from doc in documents select new { _ = SpatialIndex.Generate(doc.Latitude, doc.Longitude) };
{
  "Languages": [],
  "VersionDate": "20120314T110204",
  "VersionId": "634673197241904092",
  "SpecializationsAndDepartments": [
    {
      "Name": "Kenmore",
      "OfficeId": "offices/kenmore",
      "Latitude": 42.345295,
      "Longitude": -71.100576,
      "Specializations": [],
      "Departments": [
        "Podiatry"
      ]
    },
    {
      "Name": "Watertown",
      "OfficeId": "offices/watertown",
      "Latitude": 42.3624127,
      "Longitude": -71.1608934,
      "Specializations": [],
      "Departments": [
        "Podiatry"
      ]
    },
    {
      "Name": "Wellesley",
      "OfficeId": "offices/wellesley",
      "Latitude": 42.3146,
      "Longitude": -71.248499999999993,
      "Specializations": [],
      "Departments": [
        "Podiatry"
      ]
    }
  ],
  "ClinicianId": 2,
  "LastName": "Agoada",
  "FirstName": "David",
  "MiddleName": "",
  "Gender": "M",
  "ProfessionalDegrees": [
    "DPM"
  ],
  "ProfessionalTitles": [
    "Podiatrist"
  ],
  "IsPrimaryCarePhysician": false,
  "IsAcceptingNewPatients": false,
  "Uid": "david-agoada-2"
}

Oren Eini (Ayende Rahien)

unread,
Mar 15, 2012, 3:37:56 AM3/15/12
to rav...@googlegroups.com
Interesting, I _think_ that something like this might work:


this.Map = documents => from doc in documents

  from spc in doc.SpecializationsAndDepartments
 select new {
 _ = SpatialIndex.Generate(doc.Latitude, doc.Longitude) ,
 _1 =  SpatialIndex.Generate(spc.Latitude, spc.Longitude) 
};
But I am not sure, can you try out and see?

Jim Baltika

unread,
Mar 15, 2012, 6:04:42 PM3/15/12
to rav...@googlegroups.com
Thanks Oren! Man, you are the best "bit & byte machine" in the .NET land. Its hard to find programmers with this kind dedication and skills these days. Thanks again Jimbo
Reply all
Reply to author
Forward
0 new messages