Description

A search with two colon leads to an TypeError. This two colon, I use offen for a MetaData search, with macros or directly from the search boxes. It should work with native xapian search (and not regex moinmoin slow search).

Steps to reproduce

  1. Create a page with some MetaData (e.g.  Key:: Data 

  2. And try to search for them via FullSearch

  3. You will receive an TypeError, because of this  :: 

Example

Logfile

A FullText search for Wohnort:: Schweiz

2008-07-10 14:57:01,244 MoinMoin.search.queryparser DEBUG parse_quoted_separated items: [(u'Land', None, None), u'Schweiz']
2008-07-10 14:57:01,252 MoinMoin.failure ERROR An exception occured.
Traceback (most recent call last):
  File "/home/lotek/lib/python2.5/site-packages/MoinMoin/request/__init__.py", line 1306, in run
    handler(self.page.page_name, self)
  File "/home/lotek/lib/python2.5/site-packages/MoinMoin/action/fullsearch.py", line 185, in execute
    titlesearch=titlesearch).parse_query(needle)
  File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/queryparser.py", line 1059, in parse_query
    query = self._analyse_items(items)
  File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/queryparser.py", line 1001, in _analyse_items
    elif "title".startswith(m):
TypeError: expected a character buffer object

Component selection

Details

MoinMoin Version

1.7.0 (this Wiki)

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

use some quotes around the term "Key:: Data"

Discussion

That query is actually invalid because the query parser uses a colon to delimit prefixes like "regex:case:.*ABC". Therefore, you have to quote it.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.7XapianTypeErrorForMetaDataSearch (last edited 2008-07-11 16:52:54 by MarcelHäfner)