Setting of :key to :id in cFerret


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?

On 12/3/05, Carl Y. <carl at> 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 =
(:key => :id)

Alternatively you could handle the deletes yourself.

Hope this helps.

  • Thanks,
    > Carl
    > _______________________________________________

> Ferret-talk mailing list
> Ferret-talk at


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