Hi Jan

At this point, I don't think I'll add the option for a computed document id - 
mainly due to the fact you're the first person to require this in the life of 
TS (at least, I can't remember anyone else making this request).

What could be a viable workaround though is to use a single integer column in 
your model that'll be unique for each record in that model, and tell Sphinx to 
use that as its primary key with this line in your model:

  set_sphinx_primary_key :unique_id_column

Cheers

-- 
Pat

On 12/10/2012, at 12:34 AM, Jan Bromberger wrote:

> Hi Pat,
> 
> when using thinking sphinx with the composite primary keys gem, one gets an 
> exception like this when defining an index:
> 
> NoMethodError (undefined method `to_sym' for [:source, 
> :source_id]:CompositePrimaryKeys::CompositeKeys)
> 
> I realize that sphinx needs to have an unsigned int as a primary key, but as 
> long as one can compute one with SQL, it's okay. Could you provide a 
> configuration option to compute the id? In my case, I have a finite set of 
> sources - currently three -, so that (source_id * 3) + source would generate 
> an unsigned unique id.
> 
> The options would more or less directly be inserted into the sql_query and 
> sql_query_info options of the generated configuration file.
> 
> Without going into detail about my case, it would not be feasible for me to 
> migrate to a single column primary key.
> 
> Thanks Jan
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/thinking-sphinx/-/nfoGaH9JTOYJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/thinking-sphinx?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to