Re: [EP-underground] Questions about subjects
ePrints Support <[email protected]> Sat, 16 Nov 2002 14:24:10 +0000
| Newsgroups | gmane.comp.web.eprints.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Nov 15, 2002 at 10:08:07 -0600, Alan Schmitz wrote:
> At 11:54 AM 11/15/2002 +0000, you wrote:
>
> >On Thu, Nov 14, 2002 at 04:07:05 -0600, Alan Schmitz wrote:
>
> [...] snip
>
> >AHhh. Better yet!! Create a second IDENTICAL subjects field called something
> >like searchsubjects. In the trigger we copy all the values from field
> >subjects
> >into it then set subjects in this to all true if the user has selected the
> >general subject/field. This way if the user goes back to edit the subjects
> >field
> >it won't be a horrid mess of selected counties! You then edit the
> >simplesearch,
> >advance search and browse views to apply to field "searchsubjects".
>
> I'll have to check with the people that want to archive these documents,
> but I think the "subjectstext" field you've described below will meet most
> of their needs. I do have another couple of questions about the code
> you've provided....
>
> >This should be quite simple. OK. Assume we have 2 new fields, searchsubjects
> >and subjectstext.
>
> [...] snip
>
> > # set ALL the searchsubjects if the flag is set
> > if( $setall )
> > {
> > foreach my $subjid (
> > "dallas",
> > "foo",
> > "baz",
> > "fnord",
> > "bar" )
> > {
> > push @{$searchsubjects}, $subjid;
> > }
> > }
>
> 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" );
}
>
> >ok maybe that's more complicated than I thought. There is also the catch
> >that you will need to reindex everything if you add a new county.
>
> 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.
>
> >You would then make your keyword search over
> >title/abstract/keywords/subjectstext
> >
> >I hope all this makes some kinda sense.
>
> It makes a lot of sense. I just hope I can remember enough Perl to hold it
> all together.
>
> Thanks for you help,
> Alan Schmitz
>
> -----
> SILO Coordinator
> State Library of Iowa
>
>
> > > The second question is a little more complicated, because I'm trying to
> > use
> > > Eprints to archive some specialized documents. These documents include
> > > various data tables from the US Census Bureau. Most of the documents
> > > include information for a unique region in the state. A few documents
> > > include a single statistic about every region in the state. I'm planning
> > > on setting up a hierarchy, similar to subject, called region.
> > >
> > > A short version of this hierarchy might look like:
> > >
> > > County
> > > County : Dallas
> > > County : Polk
> > > County : Story
> > >
> > > I have a document called "Median Household Income by County", which
> > > includes the median household income for all counties in the state. I
> > want
> > > to make sure that someone doing a subject search will be able to find it,
> > > even if they're looking for the median household income for Polk County.
> > >
> > > What kind of subject hierarchy should I use, and how should I enter this
> > > document into Eprints? Should I select every county on the region
> > list, or
> > > is there a better way?
> > >
> > > Thanks,
> > > Alan Schmitz
> > >
> > >
> > > -----
> > > SILO Coordinator
> > > State Library of Iowa
> >
> >--
> >
> > Christopher Gutteridge [email protected]
> > ePrints2 Coder, Support and Stuff +44 23 8059 4833
--
Christopher Gutteridge [email protected]
ePrints2 Coder, Support and Stuff +44 23 8059 4833