A
A
Anton Misyagin2015-12-27 11:47:36
Ruby on Rails
Anton Misyagin, 2015-12-27 11:47:36

Is it possible to disable Solr manually on some operations?

Sometimes solr slows down, for example:

def show
  @item = Item.where(params[:id]).first
   #Следующие 2 строчки после комментария увеличивают время загрузки страницы на
   # 2 секунды при 50 записях в базе, хотя по полю view_count нет поиска
  @item.views_count += 1
  @item.save
  render :show_item
end

In general, is it possible to somehow disable solr manually, for example @adv.save(solr: false) , in the manner of @adv.save(validate: false) ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
4itosik, 2015-12-28
@sunnmas

You should fit

@item.update_column(:views_count, @time.views_count += 1)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question