Setting of :key to :id in cFerret


#1

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
*>


#2

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