<div dir="ltr">Hi Yuri,<div><br></div><div>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 <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flatest_tool.pl%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=LEEAX2y7NB%2Fz9dICeFaJnW1mgiWaZqu4IXUhuyP5Ws0%3D&reserved=0" originalSrc="http://latest_tool.pl/" shash="UkHWt5drDyf35dcAxMKWFmcUJ7bHCo1sDDr7A0cLKT2sY/V/kAXLLl4cgz0cdQLAOaWtb4L73Stmi6xeA82N+0uf5MiQnv8nDM1eKBYy50nm0VfJRqZo4kHuENq7TWVYQJqTo1Y95LcD/qaDgtTtrhowloCYeFfXbzjKZcoWFMQ=">latest_tool.pl</a> file that sets up the filters.</div><div><br></div><div>The part I addedlooks a bit like this, with some other parts that made it work too.</div><div><br></div><div>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. </div><div><br></div><div>This is the results page for it:</div><div><br></div><div><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flivrepository.liverpool.ac.uk%2Fcgi%2Flatest_covid&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=UUHYoqQA0%2FHwHOdxD8tkywnJOehWBtDbdiJ8GO093nc%3D&reserved=0" originalSrc="https://livrepository.liverpool.ac.uk/cgi/latest_covid" shash="vKLj920b4SHNZ2H5yjBCUHG/87DVJzDmid/OdBBompc5wAum09Q40K/D3GpFw7bdfJbLAJwSoNRJxg/nSYmsbMWN0RFysuErUOBAvT2xq7zY8SN95s7pymkGN4KRx4TPQK+Giqiksv9AZHMs9/veCx5fvdtsaucvcVBzSHyDj1c=">https://livrepository.liverpool.ac.uk/cgi/latest_covid</a> </div><div><br></div><div>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.). <br></div><div><br></div><div>Thanks again for the pointers, I really appreciate it.</div><div><br></div><div>James</div><div><br></div><div>The part I added looks a bit like this, with some other parts that made it work too:<br></div><div><br></div><div>$searchexp->add_field(        <br>        fields => [<br> $ds->field( "title" ),<br> ],<br> value => "coronavirus",<br>);<br>$searchexp->add_field(        <br>        fields => [<br> $ds->field( "keywords" ),<br> ],<br> value => "coronavirus",<br>);<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 27, 2020 at 4:57 PM Yuri via Eprints-tech <<a href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fbin%2Flift_embargos&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=cLukhhF7KPc%2F6E2dLge25IRnwV%2BZI7HxSyiOtfmrMBY%3D&reserved=0" originalSrc="https://github.com/eprints/eprints/blob/3.3/bin/lift_embargos" shash="nXsSMv1TEKYACwHV5Z79QQ9kojetdAYQZ5Uki0BAAzKVCkJkoSMEWnBzmYKm5RmjrIIeHZ7Cb8RjiSdEOkezL01zYkNZeZSvgqhKGuYPZ64HKX8SSiCbojoEbQshCRFMjH7knJGx+/K0FNZcJb+vZLohJusMWrcFLcpDJs0BgWg=" target="_blank">https://github.com/eprints/eprints/blob/3.3/bin/lift_embargos</a></p>
<p>and</p>
<p><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FAPI%3AEPrints%2FSearch&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=XtQzrGcObC2xt87Zz0TnPhxaK9I40JhOx3KCdHefYig%3D&reserved=0" originalSrc="https://wiki.eprints.org/w/API:EPrints/Search" shash="x8qJQl7Whlx5/KK5kPDE3nlOTIwQ+F0t/GtWU7dYXp1Xx11m299SYqm9i3VF1DLSua/piVCKIXuSio2LkwM20fjRFlo/vqhiESa0U32s5nxP0PeiWb3nf8FJ5u5t9Ln+GWBnw8bhzNJkyiDghzohPr4q176ib4OnviNySjOkVEU=" target="_blank">https://wiki.eprints.org/w/API:EPrints/Search</a></p>
<p>should be a good starting point<br>
</p>
<div>Il 27/04/20 17:06, James Kerwin via
Eprints-tech ha scritto:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello All,<br>
<div><br>
</div>
<div>I hope everyone is well in body and mind.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>I can get the keywords part to work using:</div>
<div><br>
</div>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div>$c->{latest_rona_modes} = {</div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> default => { citation => "noauth" },</div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> fplatest => { </div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> citation => "popular", max => 5, </div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> #citation => "result", max => 3, </div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> filters => [</div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> #{ meta_fields => [
"full_text_status","full_text_status" ], value =>
("none"||"public") }</div>
</blockquote>
</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div> { meta_fields => [ "keywords" ], value =>
"covid-19"}</div>
<div><br>
</div>
</blockquote>
</blockquote>
</blockquote>
This also works with "title" as you would expect.
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div> "OR title LIKE '%covid-19%' OR title LIKE 'coronavirus' in
MYSQL-speak.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>James</div>
</div>
<br>
<fieldset></fieldset>
<pre>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=xg5wwXZEIgsCzXQCc1ersVlPSG2DOmoTaIAvysSk%2F3E%3D&reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="CFSOjWxLfVUo3A4YoOFZ3K93eRxa+Gme5271v9pWCY03Eo4QuFIhmUM0v7Zg1fx5F1vxoc3dwZXImS45w6UbZlI2rCdDW8hUZOR25X2+Rs7RSDDTJD5G/YvYwEpJ4mNJWqzxzlf1CTpVhTtk1iCDgRgXqBJsTsc6WFMHrfSHhX0=" target="_blank">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=%2Fc3HHxA6nvhC7hZOtjUn0Gy7MWVZcA9uMrIHtDGi6b4%3D&reserved=0" originalSrc="http://wiki.eprints.org/" shash="gW5dOIBqbMh/Q84H21q+h9bfPOwiEPb8NcbMpGUVZmVySw+BcJdY57Ows5tW5FDqdR0jgPUccldgF27zZhP/E+kHF1KHuEAEMlZ8d9QEPHCdhT5DXRJQBwA9kuUC0DM2g+fHTS805YKt+A04Bo8MSnVtar/NXYZQk6pPkhngf/U=" target="_blank">http://wiki.eprints.org/</a></pre>
</blockquote>
</div>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>
*** Archive: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=xg5wwXZEIgsCzXQCc1ersVlPSG2DOmoTaIAvysSk%2F3E%3D&reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="CFSOjWxLfVUo3A4YoOFZ3K93eRxa+Gme5271v9pWCY03Eo4QuFIhmUM0v7Zg1fx5F1vxoc3dwZXImS45w6UbZlI2rCdDW8hUZOR25X2+Rs7RSDDTJD5G/YvYwEpJ4mNJWqzxzlf1CTpVhTtk1iCDgRgXqBJsTsc6WFMHrfSHhX0=" rel="noreferrer" target="_blank">http://www.eprints.org/tech.php/</a><br>
*** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C6a3693baab2a4771b16808d7eba6d0da%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=%2Fc3HHxA6nvhC7hZOtjUn0Gy7MWVZcA9uMrIHtDGi6b4%3D&reserved=0" originalSrc="http://wiki.eprints.org/" shash="gW5dOIBqbMh/Q84H21q+h9bfPOwiEPb8NcbMpGUVZmVySw+BcJdY57Ows5tW5FDqdR0jgPUccldgF27zZhP/E+kHF1KHuEAEMlZ8d9QEPHCdhT5DXRJQBwA9kuUC0DM2g+fHTS805YKt+A04Bo8MSnVtar/NXYZQk6pPkhngf/U=" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a></blockquote></div>