# Copyright 2002-2008 Josh Clark and Global Moxie, LLC. This code cannot be
# redistributed without permission from globalmoxie.com.  For more
# information, consult your Big Medium license.
#
# $Id: PageIndex.pm 3043 2008-03-31 14:00:38Z josh $

package BigMed::Search::PageIndex;
use strict;
use warnings;
use utf8;
use Carp;
use base qw(BigMed::Data);

my @site_schema = (
    {   name  => 'site',
        type  => 'system_id',
        index => 1,
    },
    {   name    => 'page',
        type    => 'system_id',
        index   => 1,
    },
    {   name    => 'words',
        type    => 'raw_text',
        multiple => 1,
    },
);
BigMed::Search::PageIndex->set_schema(
    source     => 'pageindices',
    elements   => \@site_schema,
);

1;
__END__

=head1 NAME

BigMed::Search:PageIndex - Data-backed object detailing the words in the
search index for a specific page

=head1 DESCRIPTION

BigMed::Search::PageIndex is used internally by BigMed::Search::Indexer to
store information about the words indexed for a page, for updating and
removing pages in the search index.

=head1 USAGE

BigMed::Search::PageIndex is a subclass of BigMed::Data. Please see the
BigMed::Data documentation for details about topics including:

=over 4

=item Creating a new data object

=item Saving a data object

=item Finding and sorting saved data objects

=item Data access methods

=item Error handling

=back

=head1 METHODS

BigMed::Search::PageIndex objects hold the following pieces of data. They can be
accessed and set using the standard data access methods described in the
BigMed::Data documentation. See the L<"Searching and Sorting"> section below
for details on the data columns available to search and sort.

=over 4

=item * id

The numeric ID of the object

=item * site

The numeric ID of the site to which the object belongs

=item * page

The numeric ID of the associated BigMed::Content:Page object.

=item * words

An array of words included in the BigMed::Search::Keywords search index
for this page.

=item * mod_time

=item * create_time

=back

=head2 Searching and Sorting

You can look up and sort records by any combination of the following fields.
See the C<fetch> and C<select> documentation in BigMed::Data for more info.

=over 4

=item * id

=item * mod_time

=item * site

=item * page

=back

=head1 SEE ALSO

=over 4

=item * BigMed::Data

=item * BigMed::Search::Indexer

=back

=head1 AUTHOR & COPYRIGHTS

This module and all Big Medium modules are copyright Josh Clark
and Global Moxie. All rights reserved.

Use of this module and the Big Medium content management system
are governed by Global Moxie's software licenses and may not be
used outside of the terms and conditions outlined there.

For more information, visit the Global Moxie website at
L<http://globalmoxie.com/>.

Big Medium and Global Moxie are service marks of Global Moxie
and Josh Clark. All rights reserved.

=cut
