<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>EPrints makes some decisions on what to index. Those can be
overridden, if I recall the old magics from the dawn of time.</p>
<p><a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Flib%2Fdefaultcfg%2Fcfg.d%2Findexing.pl&data=01%7C01%7C%7C2869087cc1a6427a613c08d7ece0a485%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=hFiR5RBcISoUoOQrBDXCFvHvZnk1RztxJq1nJD%2BbJP4%3D&reserved=0" originalSrc="https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/indexing.pl" shash="JMB48g7NpNmEBNVuP881j1CAK5U+lODflG1z2GMSivwHEV9cm3YWxnlRefgh641ZdleOwar+jFs/Fd5n/Hak9ZRlHXBy2BVrkcyIk5k9sRtQPX/eagPggD4zI7UwVCJ+1n3ws7gfDDUJ8wl7iVNsfNZfWaECRLRz2HhN/Hc9zDg=">https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/indexing.pl</a></p>
<p>That, by default, uses EPrints word split function
<a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fperl_lib%2FEPrints%2FIndex%2FTokenizer.pm%23L39&data=01%7C01%7C%7C2869087cc1a6427a613c08d7ece0a485%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=ZP1jFbLkYqS2NlyxJYYCBkZV%2FW7QvZ2s0WpWlW3NimA%3D&reserved=0" originalSrc="https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Index/Tokenizer.pm#L39" shash="iX4Zfb01QXW+9CSmaXibzdI2nNNvU/VtXZZG5y56gBOiXjZmySPV/9ZPC5ICZ2sJodDGgCf2lHuTMidIXcjI6pN1MKC/3E1dVC++WYcYtzuRL0Yd4s2CeZE1G+xv5ksQcBH20XzKMzG9TYYE+yV7mReZf1jnUHhR19J5LNBGLhE=">https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Index/Tokenizer.pm#L39</a>
which apparently uses the perl regexp library to decide word
breaks, but you can write one that does what you want. <span class="pl-c1"><span class="text-bold bg-yellow-light rounded-1
d-inline-block">freetext_seperator_chars seems utterly ignored
now. <br>
</span></span></p>
<p><span class="pl-c1"><span class="text-bold bg-yellow-light
rounded-1 d-inline-block">This is still obeyed </span></span><br>
<span class="pl-c1"><span class="text-bold bg-yellow-light
rounded-1 d-inline-block"><span class="pl-smi">$c</span><span class="pl-k">-></span>{<span class="pl-c1">indexing</span>}<span class="pl-k">-></span>{<span class="pl-c1">freetext_min_word_size</span>}
= 3;</span></span></p>
<p><span class="pl-c1"><span class="text-bold bg-yellow-light
rounded-1 d-inline-block">Which caused some issues for people
with Chinese name "Wu".</span></span></p>
<p><span class="pl-c1"><span class="text-bold bg-yellow-light
rounded-1 d-inline-block">I would suggest considering keeping
it by altering indexing.pl to always index numbers even if
they are one or two digits long. Something like this (of
course you'd then have to entirely reindex)<br>
</span></span></p>
<p><tt><br>
</tt><tt> # First approximation is if this word is over or
equal</tt><tt><br>
</tt><tt> # to the minimum size set in SiteInfo.</tt><tt><br>
</tt><tt> my $ok = $wordlen >=
$c->{indexing}->{freetext_min_word_size};</tt><tt><br>
</tt></p>
<p><tt><font color="#ff0000"> if( $word =~ m/^\d+$/ ) {<br>
$ok = 1;<br>
} </font></tt><br>
</p>
<div class="moz-cite-prefix">On 30/04/2020 08:27, Yuri via
Eprints-tech wrote:<br>
</div>
<blockquote type="cite" cite="mid:EMEW3|b966302d0df9e000a031a1f8b6e8872cw3Y8YW14eprints-tech-bounces|ecs.soton.ac.uk|d32bf79e-5ac1-3c16-f6d0-c890b0b95c0d@alfa.it">
<p>Hi!</p>
<p> I've found that the virus can be referred also as "SARS COV-2"
so maybe you can add also this. But beware that Eprints search
has a problem with -, it split the word using it.<br>
</p>
<div class="moz-cite-prefix">Il 27/04/20 17:06, James Kerwin via
Eprints-tech ha scritto:<br>
</div>
<blockquote type="cite" cite="mid:EMEW3|942a457e724595d3b487147e73b60d14w3QG9014eprints-tech-bounces|ecs.soton.ac.uk|CAKkNZ9Bp5Hpsxb-G9oKRtnn6-pHfcG10ob8mfYBkQ-KFcAF6Sw@mail.gmail.com">
<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:0 0 0 40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div>$c->{latest_rona_modes} = {</div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div> default => { citation => "noauth" },</div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div> fplatest => { </div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div> citation => "popular", max => 5, </div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div> #citation => "result", max => 3, </div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div> filters => [</div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<div> #{ meta_fields => [
"full_text_status","full_text_status" ], value =>
("none"||"public") }</div>
</blockquote>
</blockquote>
<blockquote style="margin:0 0 0
40px;border:none;padding:0px">
<blockquote style="margin:0 0 0
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 class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7C2869087cc1a6427a613c08d7ece0a485%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=oHll7MzmLQ%2B9xVFblp555zPkypUvEWSLQ3IM9fYvIQs%3D&reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="w3R5DHB8xCIiggOf7/WGtRHe3k0Ab2fp/M2xGXgAxMoixEU1YlExwhs0Pvh6CAOpnLOLBMvY2h8fL06Pfc8wBaiN5H99sBAyz1q39oKciOcfZFJ+4BnESOZnONMjOUO92n/z8PLgBB5/LbpVALLryBE+JVGlCdd066X2kE6vCMs=">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7C2869087cc1a6427a613c08d7ece0a485%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=pMk3%2Fok7vYtg7e7O9xGKzP6HmZGYxw8aaFznf0pre4E%3D&reserved=0" originalSrc="http://wiki.eprints.org/" shash="NxAHIfrSyQ6xk6E/BGupI66yfpnVaUxQx/YmHgmKIiBR5elc1jC7Po8rJ/9qRmINcYrJMvq7WVhDgaZiHgmiNooo9+3+RUIQMSl+z7RVgBGfTyK/eeAow44cYMAFTtS0TWw1fCf5HJ1o6pzV5uHCrNzltJw26YxUNfTsypQfHZI=">http://wiki.eprints.org/</a></pre>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=01%7C01%7C%7C2869087cc1a6427a613c08d7ece0a485%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=oHll7MzmLQ%2B9xVFblp555zPkypUvEWSLQ3IM9fYvIQs%3D&reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="w3R5DHB8xCIiggOf7/WGtRHe3k0Ab2fp/M2xGXgAxMoixEU1YlExwhs0Pvh6CAOpnLOLBMvY2h8fL06Pfc8wBaiN5H99sBAyz1q39oKciOcfZFJ+4BnESOZnONMjOUO92n/z8PLgBB5/LbpVALLryBE+JVGlCdd066X2kE6vCMs=">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=01%7C01%7C%7C2869087cc1a6427a613c08d7ece0a485%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&sdata=pMk3%2Fok7vYtg7e7O9xGKzP6HmZGYxw8aaFznf0pre4E%3D&reserved=0" originalSrc="http://wiki.eprints.org/" shash="NxAHIfrSyQ6xk6E/BGupI66yfpnVaUxQx/YmHgmKIiBR5elc1jC7Po8rJ/9qRmINcYrJMvq7WVhDgaZiHgmiNooo9+3+RUIQMSl+z7RVgBGfTyK/eeAow44cYMAFTtS0TWw1fCf5HJ1o6pzV5uHCrNzltJw26YxUNfTsypQfHZI=">http://wiki.eprints.org/</a></pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Christopher Gutteridge <a class="moz-txt-link-rfc2396E" href="mailto:totl@soton.ac.uk"><totl@soton.ac.uk></a>
You should read our team blog at <a class="moz-txt-link-freetext" href="http://blog.soton.ac.uk/webteam/">http://blog.soton.ac.uk/webteam/</a></pre>
</body>
</html>