目前我有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
上一篇:如何在Sphinx中查询精确匹配的短语?短语、精确、如何在、Sphinx
下一篇:Sphinx搜索如何使用空的BEFORE_MATCH和AFTER_MATCH如何使用、Sphinx、AFTER_MATCH、BEFORE_MATCH