#131: Correct parentheses support in in search parsing
----------------------+-----------------------------------------------------
Reporter: jblayloc | Owner: jblayloc
Type: defect | Status: new
Priority: critical | Milestone:
Component: WebStyle | Version:
Keywords: |
----------------------+-----------------------------------------------------
moved from https://savannah.cern.ch/task/index.php?13998
2010-02-17 08:26, original submission:
search_engine_query_parser should handle nested parens.
This is useful in general, but in particular:
_expand_search_patterns in search_engine_query_parser.py uses the wrong
logic:
find a mele or t compton scattering (no quote) should properly be
translated as:
author:mele or (title:compton and title:scattering)
however it was being translated as
author:mele or title:compton or title:scattering
Since the parser claims not to be able to handle nested parens,the best I
can do at the moment is:
author:mele or title:compton and title:scattering
which works better in that it fails in a slightly less spectacular manner.
Fortunately these complex searches are not very likely....
however, being able to handle nested parens would allow us to feed this
back to the parens parser and do it right.
2010-02-17 22:17, comment #1:
find a mele or t compton scattering
now becomes
author:mele or (title:compton and title:scattering)
which works unless it is embedded in another parentheses. This is unlikely
to happen, so this then is pretty reasonable. However, handling nested
parens, maybe parsing spires in a different way, would make other syntax
tricks much easier.
2010-04-01 17:44, comment #2:
Another reason this is important is that author searches in SPIRES expand
into several boolean queries, and these must be parenthesized, leading to
easy nesting...
2010-06-08 19:14, comment #3:
This awaits integration.
For discussion, see thread "SearchQueryParenthesisedParser complete..."
starting at https://groups.cern.ch/group/projec...
For code, see commit #5001a568aeb on my branch 'nested_parens_aima'.
Joe
--
Ticket URL: <http://cdswaredev.cern.ch/invenio/ticket/131>
Invenio <http://invenio-software.org>