richardwilly98 / elasticsearch-river-mongodb

MongoDB River Plugin for ElasticSearch
1.12k stars 215 forks source link

Changing a structure of MongoDB document while importing via river #518

Closed dym-ok closed 9 years ago

dym-ok commented 9 years ago

Hi Richard

I'd like to enable GeoLocation search for a type in by index, but I'm not sure how to create a proper mapping to get geo_point type field from two boolean fields.

Consider following document type in MongoDB:

"_source": {
               "PropertyCategory": 2,
               "CheckOutTime": "11 AM",
               "SupplierType": "ESR",
               "LowRate": 64.49,
               "HighRate": 74.99,
               "StateProvince": "NM",
               "Address2": "",
               "PostalCode": 88045,
               "Latitude": 32.34127,
               "StarRating": 3,
               "Address1": "1303 S Main Street",
               "City": "Lordsburg",
               "Longitude": -108.71413,
               "ChainCodeID": 17,
               "Name": "Best Western Western Skies Inn",
               "AirportCode": "SVC",
               "Confidence": "",
               "SequenceNumber": 53569,
               "Country": "US",
               "_id": 495555,
               "RegionID": 6140562,
               "PropertyCurrency": "",
               "CheckInTime": "2 PM",
               "Location": "Near Hidalgo County Library"
            }

How can I map Latitude and Longitude fields to a geo_point type field?

dym-ok commented 9 years ago

Ah, I guess all I need is Script-Filters.