开发者社区> 问答> 正文

sphinx配置sql_attr_multi:报错

在sphinx.config 配置了       

sql_attr_multi = unit enact_id from query;\
                        select id,enact_id from mv_legal_enact_ref

但是报错:

ERROR: source 'legal': expected attr type ('uint' or 'timestamp' or 'bigint') in sql_attr_multi, got 'unit enact_id from query;            select id,enact_id from mv_legal_enact_ref'.
ERROR: index 'legal': failed to configure some of the sources, will not index.
请问如何配置呢???

展开
收起
kun坤 2020-06-05 23:58:54 782 0
1 条回答
写回答
取消 提交回答
  • 字段的类型有限制,我遇到过坑。而且数值是负数也不行

    ######select id,enact_id from mv_legal_enact_ref 都是int类型,具体如何解决呢######

    最后还是自己解决了:最后留正常的答案,以便后来者:

    sql_query = SELECT id,id as legal_id from mv_legal
    sql_attr_multi = uint enact_id from query;\
                            select legal_id,enact_id from mv_legal_enact_ref

    sql_query中的legal_id 和sql_attr_multi 中legal_id 对应即可

    2020-06-05 23:59:01
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Spark SQL:Past Present &Future 立即下载
Spark SQL:Another 16x faster 立即下载
Spark SQL最佳实践 立即下载