Sun with Solr 3.5. Manually updating live search indexes

Im works with Rails 3 and Sunspot solr 3.5. My application uses Solr to index user-created content and makes it searchable for other users. The goal is to allow users to search for this data as soon as possible from the moment the user downloads it. I do not know if this corresponds to a real-time search.

My application has two models

  • Messages
  • Postitems

I index messages, including data from messages, so when a user searches for a specific description provided in a post_item entry, the corresponding post object becomes available when searching.

Users often update post_items, so every time a new post_item is added, I need to reindex the corresponding post object so that the new post_item is available during the search.

So, the moment I get the new post_item object, I run


 post_item.post.solr_index! #

which according to this documentation instantly updates the index and commits. This works, but is this the right way to handle indexing in this scenario? I read here that calling an index on a search can break solr. In addition, frequent calls with a manual index are not suitable.

Any suggestions on the right path for this. Are there any alternatives besides switching to ElasticSearch

+3
source share
2

Solr ElasticSearch, go with ElasticSearch.

Solr . : Solr / (word/pdf content) (?), , .

Rails , , ( ) , ( 5-10 ).

, .

removed all commits (i.e., !) from rails code, 
use Solr auto-commit every 5/20 seconds, 
have master/slave configuration, 
run index optimization(on Master) every 1 hour 
and more.

- , . ( 60 ).

, sunspot_index_queue gem .

+1

All Articles