On 3/12/2013 4:23 μμ, Tibor Simko wrote:
On Tue, 03 Dec 2013, [email protected] wrote:
So, briefly, what I need is a type of sub-search in the same field as
the first argument... Is there a way (using regular expressions or a
trick/hack) to make this work and get some proper results?
Right now you'd have to make a second pass: firstly, retrieve results as
you do now (including false positives); secondly, pass through results
calling field instance filtering function that would pick only the
fields having wanted another subfield.
WRT filtering, see:
http://invenio-software.org/ticket/1550
and the related commits.
So, while this is doable, and the master branch has ingredients ready,
there is some code to write and run after your searches, which may be
too slow in case there is a huge number of results returned in the first
step before the filtering step is called.
Luckily(?), I'm running master, so all the functions are there, and it's
good to know that there is a programmatic way to make it work, however
in my case i need to provide a static search string (to pass to an
external site), so that only certain records get returned to their xml
parser and displayed.
BTW just yesterday we thought about adding a special index for a similar
searching need, auhtor-at-institute, where a user would type:
ellis@CERN
and the query would return all records where 700 $a contained `ellis'
with the corresponding 700 $u containing `cern'.
So your email is coming very timely :)
P.S. The post-filtering technique could be generalised into a new
second-order search operator, say @, so that all the following
queries would be legal:
author:ellis@affiliation:CERN
author:ellis@relator:editor
title:of@provenance:arXiv
Wow! The second-order search operation is exactly what i need! This is
indeed a very powerful option to have around!
(just imagine being able to use the same idea to create a n-th order
search operator!)
Thanks for the prompt reply,
Best regards,
Theodoros
ps. I suppose that this enhancement will require a lot of new code in
several modules... Let's hope that I'll be able to patch my installation
if/when committed to master...