incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [11/22] git commit: [#2835] ticket:288 Change indexing
Date Tue, 26 Mar 2013 21:02:45 GMT
[#2835] ticket:288 Change indexing

* Don't append 'WikiPage' in title_s
* Don't append all fields into `text`


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/b5f42ced
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b5f42ced
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b5f42ced

Branch: refs/heads/master
Commit: b5f42ced3f07f5a929be1305e5e66b3c9c62eafb
Parents: c8cbb93
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu Mar 7 09:25:54 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Tue Mar 26 20:57:36 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/search.py       |    9 ++-------
 ForgeWiki/forgewiki/model/wiki.py |    2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b5f42ced/Allura/allura/lib/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index 4d73c83..44fce05 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -18,13 +18,8 @@ def solarize(obj):
     if obj is None: return None
     doc = obj.index()
     if doc is None: return None
-    text = doc.pop('text', '')
-    try:
-        text = text + pformat(doc.values())
-    except TypeError:
-        # log.exception('Indexing empty text: %s', doc)
-        text = pformat(doc.values())
-    doc['text'] = text
+    # if index() returned doc without text, assume empty text
+    doc['text'] = doc.pop('text', '')
     return doc
 
 class SearchError(SolrError):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b5f42ced/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index af88c04..dac92c7 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -129,7 +129,7 @@ class Page(VersionedArtifact, ActivityObject):
     def index(self):
         result = VersionedArtifact.index(self)
         result.update(
-            title_s='WikiPage %s' % self.title,
+            title_s=self.title,
             version_i=self.version,
             type_s='WikiPage',
             text=self.text)


Mime
View raw message