Description

A regex Full(Text)search raise an error like:

search instance has no attribute '_xapianMset'

Steps to reproduce

  1. Update to MoinMoin 1.6.1

  2. Try some regex FullText search like regex:test*

  3. An normal FullText Search works

MoinMoin Server Log

    779 2008-02-05 12:30:23,221 INFO 127.0.0.1 "GET /Index?action=fullsearch&context=180&value=regex%3Atest*&fullsearch=Text HTTP/1.1" 500 -
    780 2008-02-05 12:30:23,222 ERROR AttributeError: Search instance has no attribute '_xapianMset'
    781 Traceback (most recent call last):
    782   File "/home2/lotek/lib/python2.5/site-packages/MoinMoin/request/__init__.py", line 1283, in run
    783     handler(self.page.page_name, self)
    784   File "/home/lotek/lib/python2.5/site-packages/MoinMoin/action/fullsearch.py", line 187, in execute
    785     results = searchPages(request, query, sort, mtime, historysearch)
    786   File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/__init__.py", line 33, in searchPages
    787     historysearch=historysearch).run()
    788   File "/home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py", line 472, in run
    789     mset = self._xapianMset
    790 AttributeError: Search instance has no attribute '_xapianMset'

Example

--> -->

AttributeError

Search instance has no attribute '_xapianMset'

If you want to report a bug, please save this page and attach it to your bug report.

Traceback

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

  1. /home2/lotek/lib/python2.5/site-packages/MoinMoin/request/__init__.py in run (self=<MoinMoin.request.request_standalone.Request object at 0xae2831ac>)

    1. 1281 self.page.send_page(msg=msg)
    2. 1282 else:
    3. 1283 handler(self.page.page_name, self)
    4. 1284
    5. 1285 # every action that didn't use to raise MoinMoinNoFooter must call this now:
    • handler = <function execute at 0xae2a3b1c>
    • self = <MoinMoin.request.request_standalone.Request object at 0xae2831ac>
    • self.page = <MoinMoin.Page.Page object at 0xae1fa64c>
    • self.page.page_name = u'SystemInfo'
  2. /home/lotek/lib/python2.5/site-packages/MoinMoin/action/fullsearch.py in execute (pagename=u'SystemInfo', request=<MoinMoin.request.request_standalone.Request object at 0xae2831ac>, fieldname='value', titlesearch=0, statistic=0)

    1. 185 query = QueryParser(case=case, regex=regex,
    2. 186 titlesearch=titlesearch).parse_query(needle)
    3. 187 results = searchPages(request, query, sort, mtime, historysearch)
    4. 188 except ValueError: # catch errors in the search query
    5. 189 err = _('Your search query {{{"%s"}}} is invalid. Please refer to '
    • results undefined
    • searchPages = <function searchPages at 0xae2a3d14>
    • request = <MoinMoin.request.request_standalone.Request object at 0xae2831ac>
    • query = <MoinMoin.search.queryparser.TextSearch instance at 0xae1fa9ec>
    • sort = 'weight'
    • mtime = None
    • historysearch = 0
  3. /home/lotek/lib/python2.5/site-packages/MoinMoin/search/__init__.py in searchPages (request=<MoinMoin.request.request_standalone.Request object at 0xae2831ac>, query=<MoinMoin.search.queryparser.TextSearch instance at 0xae1fa9ec>, sort='weight', mtime=None, historysearch=0, **kw={})

    1. 30 if isinstance(query, str) or isinstance(query, unicode):
    2. 31 query = QueryParser(**kw).parse_query(query)
    3. 32 return Search(request, query, sort, mtime=mtime,
    4. 33 historysearch=historysearch).run()
    5. 34
    • historysearch = 0
    • ).run undefined
  4. /home/lotek/lib/python2.5/site-packages/MoinMoin/search/builtin.py in run (self=<MoinMoin.search.builtin.Search instance at 0xae1fa72c>)

    1. 470 self.request.cfg.xapian_search:
    2. 471 self.sort = None
    3. 472 mset = self._xapianMset
    4. 473 estimated_hits = (
    5. 474 (mset.get_matches_estimated() == mset.get_matches_upper_bound()
    • mset undefined
    • self = <MoinMoin.search.builtin.Search instance at 0xae1fa72c>
    • self._xapianMset undefined

AttributeError

Search instance has no attribute '_xapianMset'

  • args = ("Search instance has no attribute '_xapianMset'",)
  • message = "Search instance has no attribute '_xapianMset'"

System Details

  • Date: Mon, 04 Feb 2008 11:02:57 +0000
  • Platform: Linux web11.webfaction.com 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 12 17:59:08 EDT 2007 i686
  • Python: Python 2.5 (/home/lotek/bin/python)
  • MoinMoin: Release 1.6.1 (release)
Traceback.html

Component selection

Details

MoinMoin Version

1.6.1

OS and Version

Linux

Python Version

2.5.1

Server Setup

MoinServer Standalone

Server Details

Xapian 1.0.4

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

DE

Workaround

Discussion

Found it

in search/bulitin.py line 470:

   1          # when xapian was used, we can estimate the numer of matches 
   2          # Note: hits can't be estimated by xapian with historysearch enabled 
   3          if not self.request.cfg.xapian_index_history and \ 
   4                  self.request.cfg.xapian_search:           

into:

   1          # when xapian was used, we can estimate the numer of matches 
   2          # Note: hits can't be estimated by xapian with historysearch enabled 
   3          if not self.request.cfg.xapian_index_history and \ 
   4                  hasattr(self,'_xapianMset'):

As xapian search isn't allways used for searching, even when configured. When using a Regular expression for example, xamian seach is not used.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.6.1.XapianFullTextSearchRaiseAttributeError (last edited 2008-04-29 15:20:16 by ThomasWaldmann)