#861: WebSearch: fix search using parentheses inside regular expressions
-----------------------+-----------------
Reporter: lmarian | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: WebSearch | Version:
Keywords: |
-----------------------+-----------------
{{{search_pattern_parenthesised()}}} is breaking the regex search when the
search pattern contains parentheses.
Example (taken from the Invenio Search Guide - find all titles containing
words dense and matter that are separated by at most one word that doesn't
contain the letter l)
Searching for {{{title:/dense ([^ l]* )?matter/}}}
produces the following output:
{{{
Search stage 1: search_pattern_parenthesised() searched 'title:/dense ([^
l]* )?matter/'.
Search stage 1: search_pattern_parenthesised() returned ['+',
'title:/dense', '+', '[^ + l]*', '+', '?matter/'].
Search stage 1: basic search units are: [['+', '/dense', 'title', 'w']]
[...]
}}}
{{{search_pattern_parenthesised()}}} should not trigger the use of the
parenthesis parser but forward the search query as it is to the
{{{search_pattern()}}} function, like in the following example:
Searching for {{{title:/dense ([^l]* )?matter/}}} - note the missing space
between {{{^}}} and {{{l}}} inside the parentheses which will not trigger
the use of parenthesis parser - general case of {{{(foo)}}} vs {{{(foo
bar)}}}, produces the following output:
{{{
Search stage 1: basic search units are: [['+', 'dense ([^l]* )?matter',
'title', 'r']]
[..]
}}}
--
Ticket URL: <http://invenio-software.org/ticket/861>
Invenio <http://invenio-software.org>