README.md in searchjoy-0.1.0 vs README.md in searchjoy-0.2.0

- old
+ new

@@ -10,12 +10,10 @@ Works with any search platform, including Elasticsearch, Sphinx, and Solr :cupid: An amazing companion to [Searchkick](https://github.com/ankane/searchkick) -:tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource) - ## Get Started Add this line to your application’s Gemfile: ```ruby @@ -30,11 +28,11 @@ ``` Next, add the dashboard to your `config/routes.rb`. ```ruby -mount Searchjoy::Engine, at: "admin/searchjoy" +mount Searchjoy::Engine, at: "searchjoy" ``` Be sure to protect the endpoint in production - see the [Authentication](#authentication) section for ways to do this. ### Track Searches @@ -86,47 +84,47 @@ ### Authentication Don’t forget to protect the dashboard in production. -#### Basic Authentication +#### Devise -Set the following variables in your environment or an initializer. +In your `config/routes.rb`: ```ruby -ENV["SEARCHJOY_USERNAME"] = "andrew" -ENV["SEARCHJOY_PASSWORD"] = "secret" +authenticate :user, -> (user) { user.admin? } do + mount Searchjoy::Engine, at: "searchjoy" +end ``` -#### Devise +#### Basic Authentication -In your `config/routes.rb`: +Set the following variables in your environment or an initializer. ```ruby -authenticate :user, -> (user) { user.admin? } do - mount Searchjoy::Engine, at: "admin/searchjoy" -end +ENV["SEARCHJOY_USERNAME"] = "andrew" +ENV["SEARCHJOY_PASSWORD"] = "secret" ``` ### Customize -#### Time Zone - To change the time zone, create an initializer `config/initializers/searchjoy.rb` with: ```ruby Searchjoy.time_zone = "Pacific Time (US & Canada)" # defaults to Time.zone ``` -#### Top Searches - Change the number of top searches shown with: ```ruby Searchjoy.top_searches = 500 # defaults to 100 ``` -#### Live Conversions +Add additional info to the query in the live stream. [master] + +```ruby +Searchjoy.query_name = -> (search) { "#{search.query} #{search.city}" } +``` Show the conversion name in the live stream. ```ruby Searchjoy.conversion_name = -> (model) { model.name }