This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2014-09-17T00:59:46.549418+00:00 app[web.1]: Started GET "/venues/search?utf8=%E2%9C%93&q=burgers&zip=san+francisco+ca" for 75.101.56.109 at 2014-09-17 00:59:46 +0000 | |
| 2014-09-17T00:59:46.578880+00:00 app[web.1]: | |
| 2014-09-17T00:59:46.603560+00:00 app[web.1]: Google Geocoding API error: request denied. | |
| 2014-09-17T00:59:46.753376+00:00 app[web.1]: SOLR Request (148.0ms) [ path=select parameters={fq: ["type:Venue", "{!geofilt sfield=location_ll pt=, d=12.427999999999999}"], sort: "geodist(location_ll,,) asc", q: "burgers", fl: "* score", qf: "name_text^5.0 name_without_punc_text^5.0 category_text^3.5 tips_text", defType: "edismax", mm: 2, start: 0, rows: 30} ] | |
| 2014-09-17T00:59:46.760030+00:00 app[web.1]: User Load (2.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 10 LIMIT 1 | |
| 2014-09-17T00:59:46.552973+00:00 app[web.1]: The zip code is present | |
| 2014-09-17T00:59:46.911553+00:00 app[web.1]: ** [Airbrake] Failure: Net::HTTPClientError | |
| 2014-09-17T00:59:46.911564+00:00 app[web.1]: ** [Airbrake] Environment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # geocoding service (see below for supported options): | |
| #Geocoder::Configuration.lookup = :google | |
| Geocoder.configure( | |
| :lookup => :google, | |
| :timeout => 5,) | |
| # # to use an API key: | |
| # Geocoder::Configuration.api_key = "Ar9yHS5vIiJdt5tR20SqpQn6OIRwDCDCoxSlVqRmF0IILfIE-UFdM9lQRlya1YP_" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2014-09-17T00:40:16.333267+00:00 app[web.1]: Started GET "/venues/search?utf8=%E2%9C%93&q=burgers&zip=san+francisco+ca" for 75.101.56.109 at 2014-09-17 00:40:16 +0000 | |
| 2014-09-17T00:40:16.336001+00:00 app[web.1]: Geokit is using the domain: crowdsco.re | |
| 2014-09-17T00:40:16.335819+00:00 app[web.1]: Processing by VenuesController#search as HTML | |
| 2014-09-17T00:40:16.335843+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "q"=>"burgers", "zip"=>"san francisco ca"} | |
| 2014-09-17T00:40:16.430312+00:00 app[web.1]: Completed 500 Internal Server Error in 94ms | |
| 2014-09-17T00:40:16.333259+00:00 app[web.1]: | |
| 2014-09-17T00:40:16.333265+00:00 app[web.1]: | |
| 2014-09-17T00:40:16.336135+00:00 app[web.1]: The zip code is present | |
| 2014-09-17T00:40:16.388487+00:00 app[web.1]: Google Geocoding API error: over query limit. | |
| 2014-09-17T00:40:16.416392+00:00 app[web.1]: Google Geocoding API error: over query limit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SOLR Request (12.2ms) [ path=select parameters={fq: ["type:Venue", "{!geofilt sfield=location_ll pt=, d=12.427999999999999}"], sort: "geodist(location_ll,,) asc", q: "burgers", fl: "* score", qf: "name_text^5.0 name_without_punc_text^5.0 category_text^3.5 tips_text", defType: "edismax", mm: 2, start: 0, rows: 30} ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VenueSearch < ActiveRecord::Base | |
| def self.search(params) | |
| if params[:zip].present? | |
| logger.info "The zip code is present" | |
| logger.debug(Geocoder.coordinates(params[:zip])) | |
| lat, long = Geocoder.coordinates(params[:zip]) | |
| else | |
| lat = params[:latitude] | |
| long = params[:longitude] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SOLR Request (225.5ms) [ path=select parameters={fq: ["type:Venue", "{!geofilt sfield=location_ll pt=37.7749295,-122.4194155 d=12.427999999999999}"], sort: "geodist(location_ll,37.7749295,-122.4194155) asc", q: "burger", fl: "* score", qf: "name_text^5.0 name_without_punc_text^5.0 category_text^3.5 tips_text", defType: "edismax", mm: 2, start: 0, rows: 30} ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request Error: {'responseHeader'=>{'status'=>400,'QTime'=>1,'params'=>{'mm'=>'2','fl'=>'* score','sort'=>'geodist(location_ll,,) asc','start'=>'0','q'=>'steak','qf'=>'name_text^5.0 name_without_punc_text^5.0 category_text^3.5 tips_text','wt'=>'ruby','fq'=>['type:Venue','{!geofilt sfield=location_ll pt=, d=12.427999999999999}'],'rows'=>'30','defType'=>'edismax'}},'error'=>{'msg'=>'sort param could not be parsed as a query, and is not a field that exists in the index: geodist(location_ll,,)','code'=>400}} Request Data: "fq=type%3AVenue&fq=%7B%21geofilt+sfield%3Dlocation_ll+pt%3D%2C+d%3D12.427999999999999%7D&sort=geodist%28location_ll%2C%2C%29+asc&q=steak&fl=%2A+score&qf=name_text%5E5.0+name_wi...rumentation' /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/notifications.rb:123:in `block in instrument' /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /app/vendor/bund |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def save | |
| if file.present? | |
| cleanup_before_save | |
| #logger.debug "--> Trying to read csv file..." | |
| content = File.read(@file.tempfile) | |
| #logger.debug "--> Loading csv contents into db..." | |
| @csv_content = VenueImportCsv.create(content: content) | |
| process_files!(@csv_content.id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import.rb (model) | |
| def initialize(options) | |
| #attributes.each { |name, value| send("#{name}=", value) } | |
| @file = options[:file] | |
| end | |
| def save | |
| if file.present? | |
| cleanup_before_save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html { | |
| font-family: sans-serif; | |
| -ms-text-size-adjust: 100%; | |
| -webkit-text-size-adjust: 100%; | |
| } | |
| body { | |
| margin: 0; | |
| } |