{"_id":"576471c30742400e00c04717","user":"5633ec9b35355017003ca3f2","project":"56be3387be55991700c3ca0d","category":{"_id":"5764715d4f867c0e002bc8e3","version":"56be3388be55991700c3ca10","__v":0,"project":"56be3387be55991700c3ca0d","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-06-17T21:53:33.420Z","from_sync":false,"order":4,"slug":"heroku","title":"Heroku"},"parentDoc":null,"version":{"_id":"56be3388be55991700c3ca10","project":"56be3387be55991700c3ca0d","__v":8,"createdAt":"2016-02-12T19:33:28.313Z","releaseDate":"2016-02-12T19:33:28.313Z","categories":["56be3389be55991700c3ca11","57646709b0a8be1900fcd0d8","5764671c89da831700590782","57646d30c176520e00ea8fe5","5764715d4f867c0e002bc8e3","57698fa2e93bfd190028815c","576c2af16c24681700c902da","5787da96b008c91900aae865"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":5,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-06-17T21:55:15.103Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"The Websolr add-on for [Heroku](https://elements.heroku.com/addons/websolr) allows you to use our managed search service with your Heroku app.\n\nThis documentation can also be found at the [Heroku DevCenter](https://devcenter.heroku.com/articles/websolr).\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Install the addon\"\n}\n[/block]\n```\n$ heroku addons:add websolr -app APP_NAME\n```\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Choose a Solr client\"\n}\n[/block]\nThe Apache Solr search server presents an API, and there are a number of open source clients to choose from. We recommend Sunspot, although you may already be using another. We provide more general client configuration at the end of this document. See our list of Solr clients here:\n\n- [Solr Clients](doc:solr-clients)\n\n## Ruby clients\nWe recommend [Sunspot](doc:sunspot), but there are are other Ruby clients, including the venerable acts_as_solr. If you are already using one of these clients and are not interested in switching your application to Sunspot, here are a few pointers for using Websolr in production.\n\nYour index’s URL is set in the `WEBSOLR_URL` environment variable. If your Solr client can be configured at runtime, we recommend creating a Rails initializer at `config/initializer/websolr.rb` in which you instruct your client to connect to` ENV['WEBSOLR_URL']` when present.\n\nAlternatively, you may run `$ heroku config --long` from your application’s directory to view the value for WEBSOLR_URL and update the relevant configuration file for your particular Solr client.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Configuration\"\n}\n[/block]\nWhen your index is first created, it will be automatically configured using the `schema.xml` for the latest version of Sunspot, which is a very flexible schema that can cover a lot of uses.\n\nWebsolr provides a control panel at [http://websolr.com](http://websolr.com) where you may make changes to your index, such as adding or removing different Solr features, selecting a different Solr client, providing your own `schema.xml` and so on.\n\nYou may log in to the Websolr control panel at [http://websolr.com](http://websolr.com) using your account’s Websolr username and password, which you may find by running `$ heroku config --long` from your application’s directory.","excerpt":"","slug":"the-websolr-add-on","type":"basic","title":"The Websolr Add-on"}

The Websolr Add-on


The Websolr add-on for [Heroku](https://elements.heroku.com/addons/websolr) allows you to use our managed search service with your Heroku app. This documentation can also be found at the [Heroku DevCenter](https://devcenter.heroku.com/articles/websolr). [block:api-header] { "type": "basic", "title": "Install the addon" } [/block] ``` $ heroku addons:add websolr -app APP_NAME ``` [block:api-header] { "type": "basic", "title": "Choose a Solr client" } [/block] The Apache Solr search server presents an API, and there are a number of open source clients to choose from. We recommend Sunspot, although you may already be using another. We provide more general client configuration at the end of this document. See our list of Solr clients here: - [Solr Clients](doc:solr-clients) ## Ruby clients We recommend [Sunspot](doc:sunspot), but there are are other Ruby clients, including the venerable acts_as_solr. If you are already using one of these clients and are not interested in switching your application to Sunspot, here are a few pointers for using Websolr in production. Your index’s URL is set in the `WEBSOLR_URL` environment variable. If your Solr client can be configured at runtime, we recommend creating a Rails initializer at `config/initializer/websolr.rb` in which you instruct your client to connect to` ENV['WEBSOLR_URL']` when present. Alternatively, you may run `$ heroku config --long` from your application’s directory to view the value for WEBSOLR_URL and update the relevant configuration file for your particular Solr client. [block:api-header] { "type": "basic", "title": "Configuration" } [/block] When your index is first created, it will be automatically configured using the `schema.xml` for the latest version of Sunspot, which is a very flexible schema that can cover a lot of uses. Websolr provides a control panel at [http://websolr.com](http://websolr.com) where you may make changes to your index, such as adding or removing different Solr features, selecting a different Solr client, providing your own `schema.xml` and so on. You may log in to the Websolr control panel at [http://websolr.com](http://websolr.com) using your account’s Websolr username and password, which you may find by running `$ heroku config --long` from your application’s directory.