Hi Yossi

Sorry for the late follow-up, but I'm not sure why this is particularly slow. 
Granted, your query is pretty complex, so that probably doesn't help, but maybe 
it's worth asking on the Sphinx forum itself? Also, I'd try simplifying the 
query as much as possible, then adding grouping and seeing how the speed is 
then, and then one by one adding the other factors in (field weights, sorting, 
filters, etc).

Also, very likely this is unrelated, but field weights must be integers. Not 
sure if they *have* to be greater than zero, though.

-- 
Pat

On 07/02/2012, at 2:00 AM, Yossi Edri wrote:

> yes here it is:
> more then 20k recoreds
> 
> define_index  do
>     indexes title
>     indexes status
>     indexes description
>     indexes user.username , :as => :user_username
>     indexes category.name , :as => :category_name
>     indexes tags.name , :as => :tag_name
>     has :id
>     has :category_id
>     has :user_id
>     has :positive_rating
>     has :show_in_site
>     has :appear_in_homepage
>     has :featured
>     has :pushed_at
>     has :created_at
>     has :popularity
>     has :sort_rating
>     has :silly
>     has :gift
>     has :active_sales_count
>     where "status = 'approved'"
> 
>     set_property :delta => :datetime, :threshold => 50.minutes
> end
> 
> 
> Qurey:
> 
> G.search(
>     terms, 
>     :with => with,
>     :include => include_with,
>     :without => without_ids,
>     :populate => true,
>     :sort_mode => :desc,
>     :match_mode => :extended, 
>     :order => :sort_rating,
>     :field_weights => {:title => 10, :tag_name => 0, :description => 0.2},
>     :page => (page.blank? ? 1 : page), :per_page => per_page,
>     :group_by => 'user_id',
>     :group_function => :attr
>     )
> 
> 
> 
> On Mon, Feb 6, 2012 at 3:26 AM, Pat Allan <[email protected]> wrote:
> 
> Hi Yossi
> 
> Can you share your define_index block and the search query you're running? 
> Also, how many records does the model have?
> 
> --
> Pat
> 
> On 06/02/2012, at 4:02 AM, Yossi Edri wrote:
> 
> > Hi,
> > Using thinking-sphinx-1.4.3 and trying to group_by an attribute
> > resolves in very slow execution (140 sec). the attribute is an integer
> > on
> > the model (user_id) and i dont understand way it act like that.
> > I will appreciate your response....
> >
> > --
> > 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.
> >
> 
> 
> 
> --
> 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.
> 
> 
> 
> -- 
> 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.



-- 
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