[Moin-devel] Search engine slightly broken in 1.3.3

Robert Seeger robert.seeger at orsoft.de
Thu Feb 3 08:28:56 EST 2005


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






More information about the Moin-devel mailing list