In my mac you example works well. In the Ubuntu server when I rebuild
the indexes I get a seg fault:

Stopped search daemon (pid 19884).
Generating Configuration to /home/wpn/production/releases/
20120113102215/config/production.sphinx.conf
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/home/wpn/production/releases/20120113102215/config/
production.sphinx.conf'...
indexing index 'project_core'...
collected 708 docs, 1.8 MB
sorted 0.3 Mhits, 100.0% done
Segmentation fault
Started successfully (pid 19907).

And sphinx does not start properly after that. If I comment 'join
courses' the seg fault error goes any. Any idea why this is happening?

The version in the mac is Sphinx 0.9.9-release. In Ubuntu is Sphinx
0.9.8.1-release

On Jan 4, 1:07 am, "Pat Allan" <[email protected]> wrote:
> Sphinx has no concept of the number of values (no COUNT() function), so 
> you'll need to create an attribute for that purpose:
>
>   has "COUNT(DISTINCT courses.id) > 0", :as => :has_courses, :type => :boolean
>   join courses # if you're not referring to the association elsewhere
>
> And then your search would be:
>
>   Project.search :with => {:paid => true, :has_courses => true}
>
> Cheers
>
> --
> Pat
>
> On 04/01/2012, at 5:52 AM, rtacconi wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I have a project model which has a filter:
>
> > has paid, :type => :boolean
>
> > If paid checkbox is flagged, sphinx searches for paying projects. the
> > problem is that some projects have not any course:
>
> > project.courses.count # returns 0
>
> > I there a way to search for paying projects having at least one
> > course?
>
> > paid => true and projects.courses.count > 0
>
> > at the moment I have paid sent in the conditions
>
> > A solution could be to add a field set to true if its courses are more
> > than zero, but it is a redundant information
>
> > --
> > 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 
> > athttp://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