Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Geo distance search queries with Elasticsearch to provide store locator experience

Geo distance search queries with Elasticsearch to provide store locator experience

Using Geo Distance Search Queries with elasticsearch to provide store locator experience

Ram Gopinathan

June 14, 2018
Tweet

More Decks by Ram Gopinathan

Other Decks in Technology

Transcript

  1. 2 § Ram Gopinathan § Full stack engineer with 22+

    years of experience building web, mobile and distributed applications. § Multi-cloud experience (Azure, AWS, GCP) § Contact § http://twitter.com/rprakashg § http://linkedin.com/in/rprakashg § http://rprakashg.io/blog Who Am I? T-Mobile Confidential
  2. 3 About T-Mobile T-Mobile Confidential As America's Un-carrier, T- Mobile

    US, Inc. is redefining the way consumers and businesses buy wireless services through leading product and service innovation. NASDAQ traded public company – TMUS Two flagship brands: T- Mobile and MetroPCS Based in Bellevue, Washington
  3. 5 Connecting with customers § Multiple ways for customers to

    connect with T-Mobile § Stay connected & Listen to customers
  4. 6 § Rolled out our Opensource site few months back

    § http://opensource.t-mobile.com We Love Opensource T-Mobile Confidential
  5. 7 § Show customers a list of stores near their

    current location based on lat/lon values and distance Store locator T-Mobile Confidential
  6. 8 § Port the existing APIs into Serverless Architectures §

    Develop in Golang § Opensource the Dataset § Opensource the Store locator source so other retailers can provide similar store locator experiences within web or mobile POC Goals T-Mobile Confidential
  7. 10 § Official Golang SDK for Elasticsearch § https://github.com/elastic/go-elasticsearch §

    Third party Golang SDK for Elasticsearch § https://olivere.github.io/elastic/ Interacting with Elasticsearch T-Mobile Confidential
  8. 11 § Explicitly set the field mapping at the time

    of index creation Enabling Geo Searches T-Mobile Confidential
  9. 12 § Read payload from request § Use Golang csv

    package to parse CSV records § https://golang.org/pkg/encoding/csv/ § Add store records to specified index Indexing T-Mobile Confidential curl -H "Content-Type: application/json" -X PUT http://localhost:8080/1.0/index/storelocator --data-binary @20180509.StoreLocator.csv | jq
  10. 15 § Execute the search § Process results Store locator

    query - Golang T-Mobile Confidential
  11. 16 § Create a big query dataset for T-Mobile stores

    § Upload the CSV data to bigquery § Refactor indexing function to listen in dataset changes and add/update Elasticsearch index § Open source the dataset § Add digital assistant integration Next steps T-Mobile Confidential