Forum: Ferret Group by clause

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
isha kakodkar (Guest)
on 2007-07-31 13:13
(Received via mailing list)
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
Jens K. (Guest)
on 2007-07-31 13:32
(Received via mailing list)
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
removed_email_address@domain.invalid | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
isha kakodkar (Guest)
on 2007-08-03 17:49
(Received via mailing list)
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?
Jens K. (Guest)
on 2007-08-03 18:17
(Received via mailing list)
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 :-)

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
removed_email_address@domain.invalid | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
isha kakodkar (Guest)
on 2007-08-03 18:40
(Received via mailing list)
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...
isha kakodkar (Guest)
on 2007-08-08 12:49
(Received via mailing list)
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..?
This topic is locked and can not be replied to.