John Bachir 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


-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to