#53: Improve record retrieval in 'Get_Recid' function
------------------------+---------------------------------------------------
Reporter: jcaffaro | Owner:
Type: task | Status: new
Priority: major | Milestone: v1.0
Component: WebSubmit | Version: v0.99.1
Resolution: | Keywords:
------------------------+---------------------------------------------------
Old description:
> When retrieving a record to edit based on this report number, the
> 'Get_Recid' function searches for matching report numbers in the
> 'reportnumber' index. Ideally only one record should match.
>
> The problem is that the 'reportnumber' index is an aggregate of the main
> report number field (037$a on demo site) and also the additional report
> number field (088$a). In the particular scenario of two records A and B
> with the markup described below, the Get_Recid will not be able to
> uniquely identify the record to edit when trying to edit B:
>
> '''Record A:'''
> 037__a:A
> 088__a:B
>
> '''Record B:'''
> 037__a:B
>
> The best solution would be to not fall into the above case... However the
> function could still be improved by first checking in the main report
> number field (either hardcoded 037$a (!), or in a new index
> "mainreportnumber"), and falling back to searching into "reportnumber"
> index if no record matches.
New description:
When retrieving a record to edit based on this report number, the
'Get_Recid' function searches for matching report numbers in the
'reportnumber' index. Ideally only one record should match.
The problem is that the 'reportnumber' index is an aggregate of the main
report number field (037$a on demo site) and also the additional report
number field (088$a). In the particular scenario of two records A and B
with the markup described below, the Get_Recid will not be able to
uniquely identify the record to edit when trying to edit B:
'''Record A:'''
{{{
037__a:A
088__a:B
}}}
'''Record B:'''
{{{
037__a:B
}}}
The best solution would be to not fall into the above case... However the
function could still be improved by first checking in the main report
number field (either hardcoded 037$a (!), or in a new index
"mainreportnumber"), and falling back to searching into "reportnumber"
index if no record matches.
--
Comment (by jcaffaro):
In addition, the {{{search_engine.search_pattern(..)}}} function used by
Get_Recid now requires to have BibIndex run in order to search in indexes.
A workaround (such as using {{{search_engine.search_unit(..)}}}) must be
implemented.
--
Ticket URL: <http://invenio-software.org/ticket/53#comment:1>
Invenio <http://invenio-software.org>