Forum: Ferret Can't remove duplicate

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
573817a2b8cd7ddc3db11628920f7faf?d=identicon&s=25 Femto Zheng (femto)
on 2009-08-18 08:28
(Received via mailing list)
Hello all, I can't remove duplicate,I'm using ferret
to index log file in order to monitor application activity,
what I want to do is index data based on the uniqueness of
[filename,line](actullay should be [host,filename,line],
the code is following:

if !$indexer

      field_infos = =>
                                   :term_vector => :no)
      field_infos.add_field(:content, :store => :yes, :index => :yes)

      $indexer = => index_dir,
                               :field_infos => field_infos,
                               :key => [:filename, :line],

      #$indexer ||=>index_dir, :key => ['filename',
'line'], :max_buffered_docs=>100) #unique host,file_name,line
      #                               #:default_boost => 20,
      #                               :store => :yes,
      #                               :index => :untokenized,
      #                               :term_vector => :no)
but the problem is, I will index a new datum even if the [filename,line]
is same, even I change :key => ["filename", "line"], it also doesn't
what's the problem? Thanks.
This topic is locked and can not be replied to.