Re: [EP-underground] Questions about subjects

ePrints Support <[email protected]> Wed, 20 Nov 2002 17:36:11 +0000
Newsgroups gmane.comp.web.eprints.general
Message-ID <[email protected]>
yes. reindex will get each eprint in turn and call commit() 
on it which will call the set_eprints_automatic_fields routine
then write back to the database.

On Tue, Nov 19, 2002 at 09:55:33 -0600, Alan Schmitz wrote:
> At 02:24 PM 11/16/2002 +0000, you wrote:
> 
> >On Fri, Nov 15, 2002 at 10:08:07 -0600, Alan Schmitz wrote:
> 
> [...] snip
> 
> > > The hard coding of subject id's is a big concern for me.  Is there a
> > > function in Eprints to return a list of all child subject id's, given a
> > > parent's subject id?
> >
> > > Ideally I'd build the "subjecttext" field by including all of the subjects
> > > the user selected and all of the child subjects where the selected subject
> > > id starts with something like "all_".  Is this a good idea / bad idea?
> >
> >Hmm. Possibly
> >
> >my $csubj = EPrints::Subject->new( $session, "counties" );
> >foreach( $csubj->children )
> >{
> >         push push @{$searchsubjects}, $_->get_value( "subjectid" );
> >}
> 
> That looks like it will do what I need.  I can play around with pattern 
> matching and recursion from there.
> 
> > > Other than the time it takes to run, are there any down-sides to running
> > > "reindex"?
> >
> >Not off the top of my head. It should not cause triggers to run or change
> >the "last modified" date of the record, but this is new territory so go
> >slow and make sure it works as expected.
> 
> The original code to build the "subjecttext" field was supposed to be added 
> to the set_eprints_automatic_fields subroutine.  Is reindex supposed to run 
> this trigger for every eprint in the system?
> 
> Thanks again,
> Alan Schmitz
> 
> -----
> SILO Coordinator
> State Library of Iowa

-- 

 Christopher Gutteridge                   [email protected]
 ePrints2 Coder, Support and Stuff        +44 23 8059 4833