Jim: what you've suggested works for ActiveRecord and WillPaginate, but not TS
and WillPaginate.
Rahul: there's no quick way to set a default per_page value - but it should be
possible to override the search method:
def self.search(query, options = {})
super(query, {:per_page => 10_000}.merge(options))
end
However, keep in mind that the larger max_matches is, the slower your search
queries get - and if you want *everything*, then perhaps search isn't the right
approach, but SQL is?
Cheers
--
Pat
On 19/10/2010, at 12:27 AM, rahul100885 wrote:
> Thanks for replay
>
> But I am not using will_paginate.
>
> And this setting I have to do in all module so I need a generic place
> for all module
>
>
> On Oct 18, 2:58 pm, Jim Ruther Nill <[email protected]> wrote:
>> If you're using will_paginate, try adding a class method called per_page to
>> the model you're indexing.
>>
>> model Contact << ActiveRecord::Base
>>
>> def self.per_page
>> 30
>> end
>>
>> end
>>
>> On Mon, Oct 18, 2010 at 4:43 PM, rahul100885
>> <[email protected]>wrote:
>>
>>
>>
>>> Hi All,
>>
>>> I have one issue with thinking sphinx.
>>
>>> When I fire a query like this for example
>>
>>> Contact.search "" # With some condition
>>
>>> it only return 20 Record, even if there are many other matching
>>> records are present.
>>
>>> While if I use :limit then it works.
>>
>>> But I want to make this setting, as a default setting for all model so
>>> in sphinx yml I specified
>>
>>> max_matches: 10000
>>
>>> But still, it only gives 20 record only.
>>
>>> Is it their any other setting that I have to do.
>>
>>> --
>>> 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]<thinking-sphinx%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/thinking-sphinx?hl=en.
>>
>> --
>> -------------------------------------------------------------
>> visit my blog athttp://jimlabs.heroku.com
>
> --
> 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.