EPrints Technical Mailing List Archive
Message: #08143
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] EPrints Search - Latest Items
- To: eprints-tech@ecs.soton.ac.uk, Yuri <yurj@alfa.it>
- Subject: Re: [EP-tech] EPrints Search - Latest Items
- From: James Kerwin <jkerwin2101@gmail.com>
- Date: Tue, 28 Apr 2020 20:03:07 +0100
Hi Yuri,
Thank you for that. I had looked at the wiki page for this previously, but I'd not registered the add_field part. I was trying to add fiels/terms to the structure in the latest_tool.pl file that sets up the filters.
The part I addedlooks a bit like this, with some other parts that made it work too.
I'm 99% sure most on this list could do this task quicker and better than I have, but tomorrow I'll share the various bits of code and where to put them if anybody is interested.
This is the results page for it:
I've also put a box on the repo home page which updates on refresh (again, exactly how the latest_tool works just with a different search query and page title etc.).
Thanks again for the pointers, I really appreciate it.
James
The part I added looks a bit like this, with some other parts that made it work too:
$searchexp->add_field(
fields => [
$ds->field( "title" ),
],
value => "coronavirus",
);
$searchexp->add_field(
fields => [
$ds->field( "keywords" ),
],
value => "coronavirus",
);
fields => [
$ds->field( "title" ),
],
value => "coronavirus",
);
$searchexp->add_field(
fields => [
$ds->field( "keywords" ),
],
value => "coronavirus",
);
On Mon, Apr 27, 2020 at 4:57 PM Yuri via Eprints-tech <eprints-tech@ecs.soton.ac.uk> wrote:
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-techhttps://github.com/eprints/eprints/blob/3.3/bin/lift_embargos
and
https://wiki.eprints.org/w/API:EPrints/Search
should be a good starting point
Il 27/04/20 17:06, James Kerwin via Eprints-tech ha scritto:
Hello All,
I hope everyone is well in body and mind.
I need some help with the EPrints search function. I have been asked to add a box to the repository homepage that lists the latest coronavirus-related deposits.
I'm hoping to search via keywords for "coronavirus" and "covid-19". I also want to search for either of these terms in titles. To do this I'm currently butchering a copy of cgi/latest_tool.
I can get the keywords part to work using:
This also works with "title" as you would expect.$c->{latest_rona_modes} = {default => { citation => "noauth" },fplatest => {citation => "popular", max => 5,#citation => "result", max => 3,filters => [#{ meta_fields => [ "full_text_status","full_text_status" ], value => ("none"||"public") }{ meta_fields => [ "keywords" ], value => "covid-19"}
What I really want is to do a search where the keywords can be "covid-19" OR "coronavirus" as well as including some allowance for adding an:
"OR title LIKE '%covid-19%' OR title LIKE 'coronavirus' in MYSQL-speak.
Am I able to do this using the EPrints::Search plugin? I've tried reading the codumentation and experimenting with it, but I'm not getting very far.
If it's not possible I can think of a number of bodges for it, but decided it was best to attempt the proper way first.
Thanks,James
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
- Follow-Ups:
- Re: [EP-tech] EPrints Search - Latest Items
- From: James Kerwin <jkerwin2101@gmail.com>
- Re: [EP-tech] EPrints Search - Latest Items
- References:
- [EP-tech] EPrints Search - Latest Items
- From: James Kerwin <jkerwin2101@gmail.com>
- Re: [EP-tech] EPrints Search - Latest Items
- From: Yuri <yurj@alfa.it>
- Re: [EP-tech] EPrints Search - Latest Items
- From: James Kerwin <jkerwin2101@gmail.com>
- [EP-tech] EPrints Search - Latest Items
- Prev by Date: Re: [EP-tech] EPrints Search - Latest Items
- Next by Date: Re: [EP-tech] EPrints Search - Latest Items
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):