You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/03/26 22:02:45 UTC
[11/22] git commit: [#2835] ticket:288 Change indexing
[#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 <je...@gmail.com>
Authored: Thu Mar 7 09:25:54 2013 +0000
Committer: Dave Brondsema <db...@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)