A
A
Anton Misyagin2015-12-30 00:46:30
Ruby on Rails
Anton Misyagin, 2015-12-30 00:46:30

How to disable solr for save and create by default?

But you don’t know how to make SOLR indexing by default not start during save and create. Need to start manually. For example, when a user adds news, initially it does not participate in the search, then the admin publishes a post and launches a reindex for this post.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Misyagin, 2015-12-30
@sunnmas

class MySearchableModel < ActiveRecord::Base
  searchable :auto_index => false do
    integer :id
    bla bla
  end
end

class AdministratorController < ApplicationController
  def make_public
    bla bla
    MySearchableModel.reindex
    Sunspot.commit
    bla bla
  end
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question