Forum: Ferret getting the list of indexed words from ferret or aaf

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.
Luna C. (Guest)
on 2007-06-08 10:46
is the list of indexed words readily available via aaf or directly from
ferret?
John B. (Guest)
on 2007-06-08 14:16
(Received via mailing list)
On Jun 8, 2007, at 2:46 AM, Luna Claire wrote:

> is the list of indexed words readily available via aaf or directly
> from
> ferret?

See this thread:

http://www.ruby-forum.com/topic/110065
Luna C. (Guest)
on 2007-06-08 22:15
John B. wrote:

> See this thread:
>
> http://www.ruby-forum.com/topic/110065

thanks... that ref is to this snippet:

"th_hash = {}
Resource.aaf_index.ferret_index.reader.terms(:body).each {|t, f|
term_hash[t] = f }
th_sorted = term_hash.sort {|a,b| a[1]<=>b[1]}.reverse

where Resource is the model being indexed"

Thanks, John. That puts me on the right path, but there are 2 gotchas
for me here:

to be more specific,

1)  I'd like to get the index for just a specific object in my model,
but it seems the call above would return an index built on all of the
obejcts of that model... any way to just build an index and return the
terms for one object?

2) I'd also like to index text from a text_field or text_area *before
it's saved* as part of an object, so for this I'd like to be able to
pass a block of text to aaf and get the indexed terms for just that body
of text... any way to do that with aaf?

TIA
This topic is locked and can not be replied to.