On 4/13/07, Erik Morton <[EMAIL PROTECTED]> wrote:
> I'm getting the following error trying to set the field_infos for an
> IndexWriter:
>
> Ferret::Index is not missing constant FieldInfos! (ArgumentError)
>
> here's the code:
>
>          @index_writer = Ferret::Index::IndexWriter.new(
>                            :path     => my_path,
>                            :create   => true,
>                            :analyzer =>
> Ferret::Analysis::StandardAnalyzer.new,
>                            :merge_count => 2,
>                            :field_infos =>
> Ferret::Index::FieldInfos.load(IO.read(FIELD_INFO_FILE)))
>
> I'm not sure what is causing the error. Any thoughts?

This is a bug in Ferret. I've fixed it but there is no need to wait
for the next release. Just include Ferret::Index at the start and
everything should work fine;

        include Ferret::Index
        @index_writer = IndexWriter.new(
                          :path     => my_path,
                          :create   => true,
                          :analyzer => Ferret::Analysis::StandardAnalyzer.new,
                          :merge_count => 2,
                          :field_infos =>
FieldInfos.load(IO.read(FIELD_INFO_FILE)))

That should fix your problem. Let me know if it doesn't.

Cheers,
Dave

-- 
Dave Balmain
http://www.davebalmain.com/
_______________________________________________
Ferret-talk mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to