Re: [EP-underground] Questions about subjects
Alan Schmitz <[email protected]> Tue, 19 Nov 2002 09:55:33 -0600
| Newsgroups | gmane.comp.web.eprints.general |
|---|---|
| Message-ID | <[email protected]> |
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