[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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.
SHERPA services analyst developer
From: <eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk>> on behalf of Matthew Brady <Matthew.Brady at usq.edu.au<mailto:Matthew.Brady at usq.edu.au>>
Reply-To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Date: Wednesday, 27 April 2016 01:21
To: "eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>" <eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>>
Subject: Re: [EP-tech] Search form
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).