On Wed, Aug 23, 2006 at 08:22:42PM +0200, Benjamin Krause wrote:
> Hey ...
>
> I just tried to convert my code to 0.10 .. But i'm currently not sure
> how to use fields..
>
> i really like some of the new api.. its leaner and i like the fact that
> these strange consts are gone (like
> Ferret::Search::BooleanClause::Occur::MUST) ..
>
> I see that you're now having Ferret::Index::FieldInfo to describe the
> fields of the index.. thats good.. and i now see that documents and
> fields are much smaller and easier to create.. thats good as well :-)
>
> now what i dont get is how to add a field to a document.. i can create a
> new field or a document, but how to make give the field a name? i would
> expect something like
>
> doc = Document.new
> fiels = Field.new("my data to be indexed", 1.5)
> doc.add_field( 'title', field )
>
> or
>
> doc.title = field ..
>
> can't see anything like that in the API though..
it's as easy as doc[:title] = field
Jens
--
webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [EMAIL PROTECTED]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk