【问题标题】:Unique key in Sphinx狮身人面像中的唯一键
【发布时间】:2013-08-02 05:03:59
【问题描述】:

是否可以在 Sphinx 中的属性上设置唯一键?我是说

index rt
{
    type = rt
    path = /tmp/sphinx/data/rt
    rt_field = text
    rt_attr_string = some_unique_attribute  // must be unique
}

谢谢。

【问题讨论】:

    标签: database sphinx unique-constraint


    【解决方案1】:

    没有。

    您需要先运行查询(但要记住不能查询字符串属性,因此还需要将数据放在其他地方)- 然后决定要做什么。还要记住没有“锁”。

    但总的来说,sphinx 并非设计为通用数据库。您只需从 sphinx 中的真实数据库中镜像您的数据,以便对其进行查询。

    特别是 sphinx 索引并不是完全安全的(尽管 binlog 在大多数情况下将有助于恢复) - 因为假设是在数据丢失的情况下,它可以从您的数据存储中重新导入。

    【讨论】:

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