【问题标题】:Bad query in Sphinx MVASphinx MVA 中的错误查询
【发布时间】:2012-04-19 19:44:10
【问题描述】:

我有带有应用程序表的 mysql 数据库。每个应用程序可以有一个或多个开发人员,因此在 Sphinx 中我想创建多值属性以通过开发人员 ID 搜索应用程序,我尝试以这种方式创建属性:

sql_attr_multi = 来自查询的 uint 开发者; \ SELECT id, name FROM apps_developers WHERE app_id = $id

但是当我尝试构建索引时 sphinx 服务器告诉我错误:

错误:索引“应用程序”:多值属性“开发者”查询失败:“where 子句”中的未知列“$id”。

在我看来 $id 必须包含来自源查询的每个应用程序的 id 值?我是对的吗?为什么会出现这个错误?

【问题讨论】:

    标签: sphinx


    【解决方案1】:

    MVA 查询应返回所有应用程序的结果(即结果集中的第一列,与 document_id 匹配)

    sql_attr_multi = uint developers from query; \
       SELECT app_id, id FROM apps_developers ORDER BY app_id
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-31
      • 1970-01-01
      • 2011-01-07
      • 2012-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多