changeset 445:0f29cbb71223

Using scoring name and name_exact fields to improve search results Fixes #30.
author Michael Mayorov <marchael@kb.csu.ru>
date Tue, 16 Aug 2011 15:50:34 +0000
parents 6b4f5e5850a3
children d9845a326f12 be9241eaa3c4 2151ef2c8425
files MoinMoin/search/indexing.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/indexing.py	Tue Aug 16 15:32:30 2011 +0000
+++ b/MoinMoin/search/indexing.py	Tue Aug 16 15:50:34 2011 +0000
@@ -64,8 +64,8 @@
 
         common_fields = dict(
             wikiname=ID(stored=True),
-            name=TEXT(stored=True, multitoken_query="and", analyzer=item_name_analyzer()),
-            name_exact=ID,
+            name=TEXT(stored=True, multitoken_query="and", analyzer=item_name_analyzer(), field_boost=2.0),
+            name_exact=ID(field_boost=3.0),
             rev_no=NUMERIC(stored=True),
             mtime=DATETIME(stored=True),
             contenttype=TEXT(stored=True, multitoken_query="and", analyzer=MimeTokenizer()),