#261: Parentheses in search don't work with alternate search terms
-----------------------+----------------------------------------------------
Reporter: tbrooks | Owner: tbrooks
Type: defect | Status: new
Priority: critical | Milestone:
Component: WebSearch | Version:
Keywords: |
-----------------------+----------------------------------------------------
Consider the search
{{{
author:"dixon, lance j" or (author:"dixon, la j" and year:0->2011)
}}}
which is, admittedly a contrived example. Note that it must be
equivalent to
{{{
author:"dixon, lance j" or author:"dixon, la j"
}}}
given that we have no papers with years outside that range.
Yet, on inspirebeta, the first gives 255, while the second 121.
This is because author:"dixon, la j" triggers the:
{{{
No exact match found for dixon, la j, using dixon la j instead...
}}}
search modification inline when it gets no results. This is just wrong,
and is very dangerous with SPIRES-style author searches.
Similar annoyance is caused by the nearest terms box, though that doesn't
generally change the search result. (e.g.:
[http://inspirebeta.net/search?ln=en&p=find+%28t+supergtre+and+a+brooks%29+or+a+witten&f=&action_search=Search&sf=&so=d&rm=&rg=25&sc=0&of=hb]
Where there is a bunch of noise (again exacerbated with SPIRES-style
author expansion) that might be helpful, but might just be confusing.
I'm submitting a trivial patch that fixes this by setting ap=0 and
nearest_terms_box=False when search_pattern_parenthesized calls
search_pattern on the subclauses.
Note that this means that we no longer give any "help" to users if a part
_or all_ of their parenthesized query gives no results. This seems
reasonable to me, but this will extend to authors in the SPIRES syntax,
which might be less reasonable.
A better long term solution might be to refactor all of this so that, at
the end of the search, one can check on whether 0 results were found, and
give suggestions then, rather than changing/suggesting things in the
middle of a compound search, with a possible enhancement to let people
know, in a subtler way, if one of their subclauses failed to return
results.
--
Ticket URL: <http://invenio-software.org/ticket/261>
Invenio <http://invenio-software.org>