Search engine slightly broken in 1.3.3

"Robert Seeger" <[email protected]> Thu, 3 Feb 2005 17:33:07 +0100
Newsgroups gmane.comp.web.wiki.moin.devel
Message-ID <[email protected]>
In some recent 1.3 version the parameters for the search query parser were
changed:

In search.py, old version:

  class QueryParser:
    """
    Converts a Strign into a tree of Query objects
    using recursive top/down parsing
    """

    def __init__(self, **kw):
        """
        @keyword titlesearch: treat all terms as title searches
        @keyword case: do case sensitive search
        @keyword literal: 0: try to treat "needle" as a regex
                          1: "needle" is definitely NOT a regex
          XXXXXXXXXXXXX
        """

recent version from 1.3.3:

  class QueryParser:
    """
    Converts a String into a tree of Query objects
    using recursive top/down parsing
    """

    def __init__(self, **kw):
        """
        @keyword titlesearch: treat all terms as title searches
        @keyword case: do case sensitive search
        @keyword regex: treat all terms as regular expressions
        """

However some code that calls the QueryParser e.g. in wikimacro still uses
"literal" instead of "regex", meaning that the "literal" setting is ignored.

One result of this is various problems with a migrated wiki that uses some
macros (especially PageList) and expects the search expression to be treated
as a regex, which does not happen because the default for "regex" is 0.

Kind Regards,
Robert Seeger




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl