0

I have the following code in my Model:

has_many :links
 searchable do
    text :name, :as => :name_textp
    integer :membership_ordering
    text :business_description, :stored => true
    text :tags do
      tags.map(&:name)
    end
    text :links_name do
      company_links.map(&:name)
    end    
    text :links_description do
      company_links.map(&:description)
    end
    text :links_tags do
      links.map(&:tags_text) 
    end
  end

When for some reason I update the model, Solr automatically add the change to the index. But when I update links , it seems it doesn't until I manually call the sunspot:solr:reindex. I also added the following code to the association:

  searchable do
    text :name
    text :description
    text :tags_text
  end

But I can't get it work. What else do I need to do?

Flezcano
  • 1,647
  • 5
  • 22
  • 39

1 Answers1

0

have you been installing solr from scratch or with bundle install command Please have a look to this procedure, I think that will make works your ruby / solr configuration. Prefere to launch solr with :

bundle exec rake sunspot:solr:start
bundle exec rake sunspot:reindex

Enjoy :)

UPDATE 6/06 1H49 BRT Do you have set autocommit in your solrconfig.xml:

<autoCommit> 
  <maxDocs>10000</maxDocs>
  <maxTime>20000</maxTime>
</autoCommit>

UPDATE 6/06 9H41 BRT Please take a look a this post: sunset not reindexing it seems to be a common issue. Can be overpassed by performing a commit. As dzone says :

you will need regular reindexing with sunspot.

Community
  • 1
  • 1
jeorfevre
  • 2,286
  • 1
  • 17
  • 27