EPrints Technical Mailing List Archive

Message: #02544


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Search, for partial matches


OK - here's what I now have:

cfg/cfg.d/zz_postcards.pl:

---- start code ----
# We need to tell EPrints load the plugins, and we also need to tell EPrints
# /where/ to find the plugins!
use lib $c->{archiveroot}.'/cfg/plugins/';

use EPrints::DataObj::Postcard;
use EPrints::DataObj::Subscriber;
use EPrints::DataObj::SubscriberTicket;

$c->{datasets}->{postcard} = {
  class   => 'EPrints::DataObj::Postcard',
  sqlname => 'postcard',
  import  => 1,
  index => 1,
};
$c->{datasets}->{subscriber} = {
  class   => 'EPrints::DataObj::Subscriber',
  sqlname => 'subscriber',
  import  => 1,
};
$c->{datasets}->{subscriberticket} = {
  class   => 'EPrints::DataObj::SubscriberTicket',
  sqlname => 'subscriberticket',
  import  => 1,
};
__END__
---- end code ----

and in EPrints::DataObj::Postcard
---- start code ----
sub get_system_field_info {
  my ($class) = @_;

  return (
    { name         => "cardid",
      type         => "counter",
      required     => 1,
      import       => 0,
      show_in_html => 0,
      can_clone    => 0,
      sql_counter  => "postcardid"
    },
    { name          => "rev_number",
      type          => "int",
      required      => 1,
      can_clone     => 0,
      show_in_html  => 0,
      default_value => 1
    },
    { name         => "subscriberid",
      type         => "itemref",
      datasetid    => "subscriber",
      required     => 1,
      show_in_html => 0
    },
    { name       => "email",
      type       => "text",
      required   => 1,
      text_index => 1
    },
    { name     => "pos",
      type     => "int",
      required => 1
    },
    { name => "placement",
      type => "int",
    },
    { name       => "datasetid",
      type       => "id",
      text_index => 0,
    },
    { name => "objectid",
      type => "int",
    },
    { name         => "datestamp",
      type         => "time",
      required     => 0,
      import       => 0,
      render_res   => "minute",
      render_style => "short",
      can_clone    => 0
    },
    { name         => "lastmod",
      type         => "timestamp",
      required     => 0,
      import       => 0,
      render_res   => "minute",
      render_style => "short",
      can_clone    => 0
    },
    { name     => "repos",
      type     => "compound",
      multiple => 1,
      fields   => [
        { sub_name => "repoid",
          type     => "text",
        },
        { sub_name => "reponame",
          type     => "text",
        },
      ],
    },
  );

---- end code ----

Stop & Start the http server
Update the databases: eprints/bin/epadmin update_database_structure <ID>
restart the indexer

... and I'm not getting a table called postcard__index (or __rindex, or __index_grep)

(and remember, this is 3.2 - not 3.3.... so thing may be different)

On 21/01/14 16:30, Sebastien Francois wrote:
Hmmm.... so what creates the index table?

I've restarted the web server, run

~/eprints/bin/epadmin update_database_structure broker

and restarted the indexer

... but I'm not seeing postcards__rindex as a table (postcards &
postcards__ordervalues_en.... but neither __rindex or __index tables

EPrints does - it may be that your dataset is not set as "indexable"
which would explain why you're missing the __*index* tables - does your
dataset definition contains a "index" => 1 property, as per this example:

         user => {
                 sqlname => "user",
                 class => "EPrints::DataObj::User",
                 import => 1,
*                index => 1,*
                 datestamp => "joined",
         },


--

Ian Stuart.
Developer: ORI, RJ-Broker, and OpenDepot.org
Bibliographics and Multimedia Service Delivery team,
EDINA,
The University of Edinburgh.

http://edina.ac.uk/

This email was sent via the University of Edinburgh.

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.