Forum: Ferret setting of :key to :id in cFerret

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.
big mac (Guest)
on 2006-02-07 20:25
(Received via mailing list)
Hi Dave,
I've been reading this post below back in December 2005.
Is it possible to set :key to :id in cFerret like suggested below?
Thanks,
Mac


On 12/3/05, Carl Y. <carl at youngbloods.org
 <http://rubyforge.org/mailman/listinfo/ferret-talk>> wrote:
>* I seem to be getting the same document multiple times in my search
*>* results.  I'm wondering if this is because by default a document is
*>* placed in the search results every time the word you're looking for

*>* shows up.  Is that the way it works?
*
Hi Carl,

This means the document has been placed in the index more than once.
Sounds to me like you are adding the an object to the index every time

it is updated. You could try setting :key to :id. This will make sure
that :id is unique in the index. That is, every time you add an
existing document, the document is replaced.

  index = Index::Index.new
(:key => :id)

Alternatively you could handle the deletes yourself.

Hope this helps.
Dave

>* Thanks,
*>* Carl
*>*
*>* _______________________________________________

*>* Ferret-talk mailing list
*>* Ferret-talk at rubyforge.org
<http://rubyforge.org/mailman/listinfo/ferret-talk>
*>*
http://rubyforge.org/mailman/listinfo/ferret-talk
*>
David B. (Guest)
on 2006-02-08 04:45
(Received via mailing list)
Hi Mac,

I was planning on handling this in the Ruby bindings rather than in
the C code. If you don't mind me asking, what are you using cFerret
for?

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