EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #08150
< 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: Christopher Gutteridge <totl@soton.ac.uk>
- Date: Thu, 30 Apr 2020 09:29:46 +0100
EPrints makes some decisions on what to index. Those can be overridden, if I recall the old magics from the dawn of time.
https://github.com/eprints/eprints/blob/3.3/lib/defaultcfg/cfg.d/indexing.pl
That, by default, uses EPrints word split function
https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/Index/Tokenizer.pm#L39
which apparently uses the perl regexp library to decide word
breaks, but you can write one that does what you want. freetext_seperator_chars seems utterly ignored
now.
This is still obeyed
$c->{indexing}->{freetext_min_word_size}
= 3;
Which caused some issues for people with Chinese name "Wu".
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)
# First approximation is if this word is over or
equal
# to the minimum size set in SiteInfo.
my $ok = $wordlen >=
$c->{indexing}->{freetext_min_word_size};
if( $word =~ m/^\d+$/ ) {
$ok = 1;
}
Hi!
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.
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/
*** 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/
-- Christopher Gutteridge <totl@soton.ac.uk> You should read our team blog at http://blog.soton.ac.uk/webteam/
- Follow-Ups:
- Re: [EP-tech] EPrints Search - Latest Items
- From: Christopher Gutteridge <totl@soton.ac.uk>
- 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: Christopher Gutteridge <totl@soton.ac.uk>
- [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] EPrints/CRIS
- Next by thread: [EP-tech] DOI handling in orcid_support_advance
- Index(es):