【问题标题】:Thinking Sphinx hangs while indexing索引时思考 Sphinx 挂起
【发布时间】:2013-01-24 22:42:30
【问题描述】:

我正在使用 Thinking Sphinx 为包含 43,000 条记录的单个表建立索引。当我尝试对其进行索引时,该过程运行非常缓慢并在 36,000 后冻结。

我认为数据有问题,并试图找出导致问题的索引。删除除 11 个索引之外的所有索引后,我仍然始终看到错误。但问题是:似乎没有一个单一的索引是罪魁祸首。如果我删除最后 11 个中的任何一个,则该过程将在不冻结的情况下完成。如果我把它加回来,问题又回来了。 (虽然我注意到当我删除其中一个索引时,该过程仍然会减慢很多,达到 39,000。)

所以现在我被难住了。我有足够的内存和磁盘空间,所以这不是问题。我将 sql_range_step 设置为 15000,将 mem_limit 设置为 2047M。没有任何帮助。

这是我精简的索引列表:

  define_index do
    indexes :email
    has :id, :as => :code
    has :premium_school_id
    has :current_employer_account_id
    has :years_experience_id
    has :user_status_id
    has practice_areas(:id), :as => :practice_area_ids
    has languages(:id), :as => :language_ids
    has preferred_employer_types(:id), :as => :preferred_employer_type_ids
    has geographical_regions(:id), :as => :geographical_region_ids
    has workflow_events(:id), :as => :workflow_event_ids
  end

欢迎提出任何想法。

【问题讨论】:

    标签: ruby-on-rails sphinx thinking-sphinx


    【解决方案1】:

    Pat Allan 最近为我回答了一个类似的问题,可能值得在这个帖子上阅读一下,看看它是否有帮助。

    基本上,这与来自 has_and_belongs_to_many 关系的大量连接以及 Thinking Sphinx 生成结果 SQL 的方式有关。

    https://groups.google.com/d/msg/thinking-sphinx/CBdWy-RivaU/tBRlLci83IkJ

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多