changeset 1490:1660b71d2316

show full-search hint if no results found with titlesearch
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Fri, 25 Aug 2006 13:34:04 +0200
parents cd788728a7ec
children 92c7972c8d54
files MoinMoin/action/fullsearch.py
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/fullsearch.py	Fri Aug 25 13:25:31 2006 +0200
+++ b/MoinMoin/action/fullsearch.py	Fri Aug 25 13:34:04 2006 +0200
@@ -148,9 +148,21 @@
             return
     # no hits?
     elif not results.hits:
+        f = request.formatter
+        querydict = wikiutil.parseQueryString(request.query_string)
+        querydict.update({'titlesearch': 0})
+
         err = _('Your search query {{{"%s"}}} didn\'t return any results. '
                 'Please change some terms and refer to HelpOnSearching for '
-                'more information.') % needle
+                'more information.%s') % (needle,
+                    titlesearch and ''.join([
+                        '<br>',
+                        _('(!) Consider performing a'), ' ',
+                        f.url(1, href=request.page.url(request, querydict,
+                            escape=0, relative=False)),
+                        _('full-text search with your search terms'),
+                        f.url(0), '.',
+                    ]) or '')
         Page(request, pagename).send_page(request, msg=err)
         return