EPrints Technical Mailing List Archive

Message: #05618


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

Re: [EP-tech] Search form


Hi Matt / Lessard

I don't think virtual fields will work for searching (if I've understood the problem correctly).  Virtual fields don't store values in the database, and in general, searching is operating on the database.

When I have issues like this, I tend to use automatic fields to solve it.  How about this:

1) Create a new multiple volatile field called all_contributors_unite_ids
2) in eprint_fields_automatic, add code that will pull all the unite_ids of all the creators, editors and contributors and store them in the new field
3) use the that field as the target of your search.

There's a training video on automatic fields here: https://wiki.eprints.org/w/Training_Video:Automatic_Fields

Note that there's one issue with this: if your user records change, you will need to recommit the publications associated with that user record.  You can do with user_fields_automatic -- on commit do a search for eprints with this userid in any of the 'person' fields, and recommit them.

 

Jisc

Adam Field
SHERPA services analyst developer


From: <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Matthew Brady <Matthew.Brady@usq.edu.au>
Reply-To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Date: Wednesday, 27 April 2016 01:21
To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
Subject: Re: [EP-tech] Search form

Hi Lessard,

 

We implemented our system a little differently that Gilles did with Cirad.

 

We re-used the original creator_id field, and update its contents as the author records get manipulated.  We also wrote custom view render logic for the double hop we make, from creator->author_instance_id->author_id, so our browse by author view (http://eprints.usq.edu.au/view/uniqueauthor/)  is listing the Unique Authors by name, then any cited name used.  Virtual Fields would likely streamline this process a bit more…

 

There are Training Video’s on the eprints wiki, https://wiki.eprints.org/w/Category:Training_Video

 

The one I think would suit this application is the Virtual Fields video (https://wiki.eprints.org/w/Training_Video:Virtual_Fields). 

From the description…

 

“Virtual Meta Fields are fields that are not stored in the database, instead

their input and output is programmed. They can be used whenever a default

display-value is not suitable. Since their value is calculated their uses are

limited by one's imagination.”

 

So you could create a virtual field, that handles all the linkages between datasets, and provides a single point of data for your search screen.

 

I think I have the process correct in my head, but I am happy for anyone (John, Ian, Adam) to point out any problems with understanding J

 

Cheers

 

Matt.

 

 

 

 

 

 

_____________________________________________________________
This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt.

The University of Southern Queensland is a registered provider of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081 )

Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.

Jisc Services Limited is a wholly owned Jisc subsidiary and a company limited by guarantee which is registered in England under company number 2881024, VAT number GB 197 0632 86. The registered office is: One Castle Park, Tower Hill, Bristol BS2 0JA. T 0203 697 5800.