Question

Is it possible to set a unique key on the attribute in Sphinx? I mean

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

Thanks.

Was it helpful?

Solution

No.

You would need to run a query first (but remembering that string attributes cant be queried, so would need to also put the data somewhere else) - and then decide what to do. Also remember there is no 'locks'.

But as a general point, sphinx is NOT designed to be a general database. You just mirror your data from the real database in sphinx, so it can be queried.

In particular sphinx indexes are not completely crash safe (altough binlog will help recover in most cases) - because the assumption is that in case of data loss, it can just be reimported from your datastore.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top