Solving the "Brooklyn Problem"

30
Solving The Brooklyn Problem: Better UX through cheap hacks Kellan Elliott-McCrea, Etsy @kellan Thursday, April 21, 2011

description

Better UX through cheap hacks

Transcript of Solving the "Brooklyn Problem"

Page 1: Solving the "Brooklyn Problem"

Solving The Brooklyn Problem:Better UX through cheap hacks

Kellan Elliott-McCrea, Etsy@kellan

Thursday, April 21, 2011

Page 2: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 3: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 4: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 5: Solving the "Brooklyn Problem"

1. UI/UX can be improved by applying ambient location information

Thursday, April 21, 2011

Page 6: Solving the "Brooklyn Problem"

1. UI/UX can be improved by applying ambient location information2. It’s easy.

Thursday, April 21, 2011

Page 7: Solving the "Brooklyn Problem"

The Brooklyn Problem

Thursday, April 21, 2011

Page 8: Solving the "Brooklyn Problem"

Brooklyn, New York Brooklyn, Alabama

The Brooklyn Problem

Thursday, April 21, 2011

Page 9: Solving the "Brooklyn Problem"

if ($query == ‘Brooklyn’) {return ‘Brooklyn, NY’;}

Thursday, April 21, 2011

Page 10: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 11: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 12: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 13: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 14: Solving the "Brooklyn Problem"

Solr 3.10, Maxmind world populations dataset, bash, and an “algorithm”

Thursday, April 21, 2011

Page 15: Solving the "Brooklyn Problem"

<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>

....

<field name="latlong" type="location" indexed="true" stored="true" required="true" />

schema.xml:

Solr geo-spatial extension 3.10+

Thursday, April 21, 2011

Page 16: Solving the "Brooklyn Problem"

<?php

$fh = fopen('worldcitiespop.txt', 'r'); $row = fgetcsv($fh); // discard headers for($i=0;$i<100;$i++) { $row = fgetcsv($fh); $json = array('add'=> array('doc' => array( 'terms' => $row[2] . ' ' . $row[0], // city country 'population' => $row[4], 'latlong' => $row[5] . ',' . $row[6], // "latitude,longitude" gets parsed ))); curl_post(json_encode($json)); } } function curl_post($json, $url='http://localhost:8983/solr/update/json') { $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADERS, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_URL, $URL); }?>

ALL THE CODE!

Thursday, April 21, 2011

Page 17: Solving the "Brooklyn Problem"

“a custom Solr scoring function to re-rank results based on social geo-relevance”

Thursday, April 21, 2011

Page 18: Solving the "Brooklyn Problem"

div(geodist(),sqrt(sum(population,1))

Thursday, April 21, 2011

Page 19: Solving the "Brooklyn Problem"

http://localhost:8393/solr/placesuggest/select?q=b*&sfield=latlong&pt=37.7749295,-122.4194155&sort=div(geodist(),sqrt(sum(population,1)))%20asc

Thursday, April 21, 2011

Page 20: Solving the "Brooklyn Problem"

http://localhost:8393/solr/placesuggest/select?q=b*&sfield=latlong&pt=37.7749295,-122.4194155&sort=div(geodist(),sqrt(sum(population,1)))%20asc

OMG CONTEXT SENSITIVE PERSONALIZED

GEOCODING!!!!!

Thursday, April 21, 2011

Page 21: Solving the "Brooklyn Problem"

Done!

Thursday, April 21, 2011

Page 22: Solving the "Brooklyn Problem"

* Solr 3.10+ working geo-spatial extensions* 2.6 million points == 380Mb index* the data sucks, and it doesn’t matter (much)* a few days of work, 85% increase in data quality.

the tear down

Thursday, April 21, 2011

Page 23: Solving the "Brooklyn Problem"

.Wanjialing, China

Thursday, April 21, 2011

Page 24: Solving the "Brooklyn Problem"

Brooklyn NY, population: 0

Thursday, April 21, 2011

Page 25: Solving the "Brooklyn Problem"

So why aren’t people doing this?

Thursday, April 21, 2011

Page 26: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 27: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 28: Solving the "Brooklyn Problem"

Thursday, April 21, 2011

Page 29: Solving the "Brooklyn Problem"

Solr 3.10, Maxmind world populations dataset, bash, and an “algorithm”

Thursday, April 21, 2011