Group by clause

Hi
Does acts_as_ferret support a :group clause?
For e.g any rails options like :select or :group etc? or is it that it
supports only few of such options?Like it supports :include

Thanks

On Tue, Jul 31, 2007 at 02:12:23AM -0700, isha kakodkar wrote:

Hi
Does acts_as_ferret support a :group clause?
For e.g any rails options like :select or :group etc? or is it that it
supports only few of such options?Like it supports :include

you can put whatever AR options you like into the second argument hash
of find_by_contents.

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

ok…and how do i achieve find_id_by_contents search with where
condition
but support of “or” and “and”?

when i search a query string and provide
Messages.full_text_search(“searching, user_id:#{user_id} name:#{name}”,
{:page =>(params[:page]||1), :sort => s})
It searches for all ids where user_id is the given value and name is the
given value.
But if i want to achieve a “or” between the 2 conditions how do i do
it?

I tried it and dint get the resultset…But i messed up something i
guess…Thanks.
I had something more to it also…
Which all sql conditions i can specify with
find_id_by_contents?OR,AND…
what about ‘IN’ clause?
Or do i have to do that with find_by_contents when the sql is getting
fired…

On Fri, Aug 03, 2007 at 06:48:46AM -0700, isha kakodkar wrote:

ok…and how do i achieve find_id_by_contents search with where condition
but support of “or” and “and”?

when i search a query string and provide
Messages.full_text_search(“searching, user_id:#{user_id} name:#{name}”,
{:page =>(params[:page]||1), :sort => s})
It searches for all ids where user_id is the given value and name is the
given value.
But if i want to achieve a “or” between the 2 conditions how do i do it?

By specifying ‘OR’ between them in your query :slight_smile:

You can also change the default behaviour to OR queries with the
:or_default Ferret configuration variable.

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

hi,
while providing conditions during index file search,do i have to give
the
exact value?or can i specify condition like
“id>4”…i tried but couldnt get it working…Can you please help…?