The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# ***********************************************
# 
# !!!! DO NOT EDIT !!!!
# 
# This file was auto-generated by Build.PL.
# 
# ***********************************************
# 
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

=encoding utf8

=head1 NAME

Lucy::Document::Doc - A document.

=head1 SYNOPSIS

    my $doc = Lucy::Document::Doc->new(
        fields => { foo => 'foo foo', bar => 'bar bar' },
    );
    $indexer->add_doc($doc);

Doc objects allow access to field values via hashref overloading:

    $doc->{foo} = 'new value for field "foo"';
    print "foo: $doc->{foo}\n";

=head1 DESCRIPTION

A Doc object is akin to a row in a database, in that it is made up of one
or more fields, each of which has a value.

=head1 CONSTRUCTORS

=head2 new

    my $doc = Lucy::Document::Doc->new(
        fields => { foo => 'foo foo', bar => 'bar bar' },
    );

Create a new Document.

=over

=item *

B<fields> - Field-value pairs.

=item *

B<doc_id> - Internal Lucy document id.  Default of 0 (an
invalid doc id).

=back

=head1 METHODS

=head2 set_doc_id

    $doc->set_doc_id($doc_id);

Set internal Lucy document id.

=head2 get_doc_id

    my $int = $doc->get_doc_id();

Retrieve internal Lucy document id.

=head2 store

    $doc->store($field, $value);

Store a field value in the Doc.

=over

=item *

B<field> - The field name.

=item *

B<value> - The value.

=back

=head2 get_fields

    my $hashref = $doc->get_fields();

Return the Doc's backing fields hash.

=head2 get_size

    my $int = $doc->get_size();

Return the number of fields in the Doc.

=head2 extract

    my $obj = $doc->extract($field);

Retrieve the field’s value, or NULL if the field is not present.

=head2 field_names

    my $arrayref = $doc->field_names();

Return a list of names of all fields present.

=head1 INHERITANCE

Lucy::Document::Doc isa Clownfish::Obj.

=cut