Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

use one solr instance for two rails apps

use one solr instance for two rails apps  using -'ruby-on-rails,solr,sunspot'

I have a server set up with several Rails apps, two of which are using Solr Sunspot. However, Solr is returning irrelevant results for a given search, and I believe the problem boils down to not having separated Solr/Sunspot to handle two Rails apps.

I have this in one app:

class Article < ActiveRecord::Base
  searchable do
    text :title, :boost => 2.0
    text :body do
      strip_tags body
    time :created_at

and this in the other:

class Article < ActiveRecord::Base
  searchable do
    text :title, :body

And my sunspot.yml files are basically identical:

    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/default
    solr_home: solr

    hostname: localhost
    port: 8982
    log_level: INFO
    path: /solr/development

    hostname: localhost
    port: 8981
    log_level: WARNING
    path: /solr/test

my solr.xml for both apps reads:

<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
  <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
    <core name="default"     instanceDir="." dataDir="default/data"/>
    <core name="development" instanceDir="." dataDir="development/data"/>
    <core name="test"        instanceDir="." dataDir="test/data"/>

Is there a way to have 1 Solr instance index and deliver results for 2 Rails apps?

I haven't found much documentation on this so am a bit confused as to how to do this.

Any help is much appreciated. Thanks!

asked Oct 11, 2015 by badhwar.rohit
0 votes
1 view

Related Hot Questions

Government Jobs Opening