深度联想和狮身人面像指数与思考型狮身人面像? [英] Deep association and Sphinx index with Thinking Sphinx?

查看:0
本文介绍了深度联想和狮身人面像指数与思考型狮身人面像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有ff表:

Teams
id

Team_User
team_id, user_id

Users
user_id

Item
id
team_id

和ff。型号:

Team
has_and_belongs_to_many :users

User
has_and_belongs_to_many :teams

Item
belongs_to :audit_team, :class_name => "Team", :foreign_key => "team_id"

我尝试存档的原因是让Sphinx为与Item关联的所有user_id编制索引,于是我提出了这个索引定义:

  define_index do
    has audit_team.users(id), :as => :team_users
  end

我不确定这是对是错。此外,Seam认为Sphinx没有为此构建配置。当我重新构建、重新索引并运行应用程序时,ff。出现错误:

index ncpar_core: no such filter attribute 'team_users'

可能是什么问题,如何将其存档?

非常感谢

推荐答案

您可能需要在添加属性后运行ts:rebuild,以便Sphinx知道它。此外,可能是这里的拼写错误,而不是代码中的拼写错误,但属性定义中的id应该是一个符号:

has audit_team.users(:id), :as => :team_users

这篇关于深度联想和狮身人面像指数与思考型狮身人面像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆