Solr presents a HTTP API for your application to use. Configuration in most cases is a simple matter of providing the URL of your Websolr index to your client.
Here we present a quick tour through the bare minimum you need to know to configure various Solr clients.
solr = RSolr.connect url: "http://index.websolr.com/solr/0a1b2c3d4e5f"
Directly in Ruby:
Sunspot.config.solr.url = "http://index.websolr.com/solr/0a1b2c3d4e5f"
Alternately, in a config/sunspot.yml
file:
production:
solr:
hostname: index.websolr.com
port: 80
path: /solr/0a1b2c3d4e5f
TanningBed.solr_connection("http://index.websolr.com/solr/0a1b2c3d4e5f")
HAYSTACK_SOLR_URL = 'http://index.websolr.com/solr/0a1b2c3d4e5f'
s = solr.SolrConnection('http://index.websolr.com/solr/0a1b2c3d4e5f')
solr_interface = sunburnt.SolrInterface("http://index.websolr.com/solr/0a1b2c3d4e5f")
conn = Solr('http://index.websolr.com/solr/0a1b2c3d4e5f')
Startup.Init<Product>("http://index.websolr.com/solr/0a1b2c3d4e5f");
(Where Product
is your Solr document mapping class.)
$options = array (
'hostname' => 'index.websolr.com',
'port' => 80,
'path' => '/solr/0a1b2c3d4e5f'
);
$client = new SolrClient($options);
$solr = new Apache_Solr_Service('index.websolr.com', 80, '/solr/0a1b2c3d4e5f');
SolrServer server = new CommonsHttpSolrServer("http://index.websolr.com/solr/0a1b2c3d4e5f");
[[https://websolr.com/system/guides/assets/images/wordpress.png|width=620px|height=276px]]
[[https://websolr.com/system/guides/assets/images/drupal.png|width=620px|height=269px]]