Forum: Ferret more specific queries via IndexReader

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.
D0347a9af192d23f47056bd253743dcf?d=identicon&s=25 John Bachir (Guest)
on 2007-06-16 21:00
(Received via mailing list)
We would like to show a list of "most recently added terms", meaning,
the results of this query:

Resource.aaf_index.ferret_index.reader.terms(:summary)

BUT, only returning terms from a certain set of documents (in our
case, we are going to filter by creation data).

Is this possible?

Thanks,
John
D0347a9af192d23f47056bd253743dcf?d=identicon&s=25 John Bachir (Guest)
on 2007-06-16 21:21
(Received via mailing list)
On Jun 16, 2007, at 2:59 PM, John Bachir wrote:

> We would like to show a list of "most recently added terms", meaning,
> the results of this query:
>
> Resource.aaf_index.ferret_index.reader.terms(:summary)
>
> BUT, only returning terms from a certain set of documents (in our
> case, we are going to filter by creation data).
>
> Is this possible?
>

Actually I just discovered that when using the drb server, the
ferret_index cannot be accessed. So I imagine it is impossible to
access the index's terms at all?

John
C9dd93aa135988cabf9183d3210665ca?d=identicon&s=25 Jens Kraemer (Guest)
on 2007-06-25 13:58
(Received via mailing list)
On Sat, Jun 16, 2007 at 03:20:27PM -0400, John Bachir wrote:
> >
> > Is this possible?
> >
>
> Actually I just discovered that when using the drb server, the
> ferret_index cannot be accessed. So I imagine it is impossible to
> access the index's terms at all?

Yeah, the DRb server is not exposing the ferret index to the outside.
You can however extend aaf's LocalIndex class (where ferret_index is
available) with a custom terms method and call that via DRb (aaf_index
is an instance of LocalIndex in local and of RemoteIndex in DRb mode,
but RemoteIndex routes all calls via method_missing through to the
remote LocalIndex instance).

Just be sure to not pull complex Ferret objects (like IndexReaders)
across the DRb connection.

regarding the original problem - I'm not sure but would guess you can't
filter the terms result to only include terms from some documents.

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
kraemer@webit.de | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
This topic is locked and can not be replied to.