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? Thanks, Carl
On 12/3/05, Carl Youngblood <carl at youngbloods.org> 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 >
Thanks Dave. I''ll add the :key => :id. On 12/2/05, David Balmain <dbalmain.ml at gmail.com> wrote:> 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
Hi, Carl. Some info about it could be found in HowTo http://ferret.davebalmain.com/trac/wiki/HowTos see "How to use keys for document". Feel free to add or fix any tips''n''tricks about Ferret to wiki. On 12/3/05, Carl Youngblood <carl at youngbloods.org> wrote:> > Thanks Dave. I''ll add the :key => :id. > > On 12/2/05, David Balmain <dbalmain.ml at gmail.com> wrote: > > 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 > > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-- anatol (http://pomozov.info) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20051203/56bab187/attachment.htm