Luna Claire
2007-Jun-08 06:46 UTC
[Ferret-talk] getting the list of indexed words from ferret or aaf
is the list of indexed words readily available via aaf or directly from ferret? -- Posted via http://www.ruby-forum.com/.
John Bachir
2007-Jun-08 10:16 UTC
[Ferret-talk] getting the list of indexed words from ferret or aaf
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 Claire
2007-Jun-08 18:15 UTC
[Ferret-talk] getting the list of indexed words from ferret or aaf
John Bachir wrote:> See this thread: > > http://www.ruby-forum.com/topic/110065thanks... 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 -- Posted via http://www.ruby-forum.com/.