The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Metabase::Index - Interface for Metabase indexing

VERSION

version 0.016

SYNOPSIS

  package Metabase::Index::Bar;
  use Metabase::Fact;
  use Moose;
  with 'Metabase::Index';
  
  # define Moose attributes
  
  sub add {
    my ( $self, $fact ) = @_;
    # index a fact
  }

  sub search {
    my ( $self, %spec ) = @_;
    # conduct search 
    return \@matches;
  }

DESCRIPTION

This describes the interface for indexing and searching facts. Implementations must provide the add and search methods.

USAGE

exists

  if ( $index->exists( $guid ) ) { do_stuff() }

This interface provides an exists method that calls search() and returns a boolean value.

  for $guid ( @{ $index->search( %spec ) } ) {
    # do stuff
  }

Returns an arrayref of GUIDs satisfying the search spec. Exact semantics of the search spec are still under development. At a minimum, a list of key value pairs should be considered to be an "AND" operation testing for equality.

Keys should be keys from core, content, or resource metadata. E.g.

  core.guid
  core.type
  core.resource
  content.somefield

BUGS

Please report any bugs or feature using the CPAN Request Tracker. Bugs can be submitted through the web interface at http://rt.cpan.org/Dist/Display.html?Queue=Metabase

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHORS

  • David Golden <dagolden@cpan.org>

  • Ricardo Signes <rjbs@cpan.org>

  • Leon Brocard <acme@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2010 by David Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004