Skip to content

Latest commit

 

History

History
108 lines (71 loc) · 2.04 KB

solr-client-configuration-overview.md

File metadata and controls

108 lines (71 loc) · 2.04 KB

Solr Client Configuration Overview

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.

Ruby (Ruby on Rails)

RSolr

solr = RSolr.connect url: "http://index.websolr.com/solr/0a1b2c3d4e5f"

Sunspot

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

Tanning Bed

TanningBed.solr_connection("http://index.websolr.com/solr/0a1b2c3d4e5f")

Python (Django)

Haystack

HAYSTACK_SOLR_URL = 'http://index.websolr.com/solr/0a1b2c3d4e5f'

solrpy

s = solr.SolrConnection('http://index.websolr.com/solr/0a1b2c3d4e5f')

Sunburnt

solr_interface = sunburnt.SolrInterface("http://index.websolr.com/solr/0a1b2c3d4e5f")

pysolr

conn = Solr('http://index.websolr.com/solr/0a1b2c3d4e5f')

ASP.NET

SolrNet

Startup.Init<Product>("http://index.websolr.com/solr/0a1b2c3d4e5f");

(Where Product is your Solr document mapping class.)

PHP (Zend, CakePHP, CodeIgniter)

Apache Solr PHP extension

$options = array (
  'hostname' => 'index.websolr.com',
  'port' => 80,
  'path' => '/solr/0a1b2c3d4e5f'
);
$client = new SolrClient($options);

Pure PHP client

$solr = new Apache_Solr_Service('index.websolr.com', 80, '/solr/0a1b2c3d4e5f');

Java

SolrJ

SolrServer server = new CommonsHttpSolrServer("http://index.websolr.com/solr/0a1b2c3d4e5f");

Wordpress

[[https://websolr.com/system/guides/assets/images/wordpress.png|width=620px|height=276px]]

Drupal

[[https://websolr.com/system/guides/assets/images/drupal.png|width=620px|height=269px]]