incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [23/40] git commit: [#2835] ticket:303 Append all fields into inside the ticket's index()
Date Mon, 01 Apr 2013 14:27:42 GMT
[#2835] ticket:303 Append all fields into  inside the ticket's index()


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

Branch: refs/heads/cj/5963
Commit: 186cf48763ededb55c6594879476d6e1a2e5dcba
Parents: e3b30ad
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Mar 15 09:46:21 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Tue Mar 26 20:57:39 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/search.py               |    5 -----
 ForgeTracker/forgetracker/model/ticket.py |    7 +++++++
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/186cf487/Allura/allura/lib/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index a6587f1..a428c53 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -1,7 +1,6 @@
 import re
 import socket
 from logging import getLogger
-from pprint import pformat
 
 import markdown
 from pylons import tmpl_context as c, app_globals as g
@@ -18,10 +17,6 @@ def solarize(obj):
     # if index() returned doc without text, assume empty text
     if not doc.get('text'):
         doc['text'] = ''
-    # Tracker uses search with default solr parser. It would match only on
-    # `text`, so we append all other field values into `text`, to match on it too.
-    if getattr(obj, 'type_s', '').lower() == 'ticket':
-        doc['text'] += pformat(doc.values())
     return doc
 
 class SearchError(SolrError):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/186cf487/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index dbfda81..db7113a 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -7,6 +7,7 @@ from datetime import datetime, timedelta
 import pymongo
 from pymongo.errors import OperationFailure
 from pylons import tmpl_context as c, app_globals as g
+from pprint import pformat
 
 from ming import schema
 from ming.utils import LazyProperty
@@ -209,6 +210,9 @@ class TicketHistory(Snapshot):
                 self.version, orig.summary),
             type_s='Ticket Snapshot',
             text=self.data.summary)
+        # Tracker uses search with default solr parser. It would match only on
+        # `text`, so we're appending all other field values into `text`, to match on it too.
+        result['text'] += pformat(result.values())
         return result
 
 class Bin(Artifact, ActivityObject):
@@ -319,6 +323,9 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
             result['reported_by_s'] = self.reported_by.username
         if self.assigned_to:
             result['assigned_to_s'] = self.assigned_to.username
+        # Tracker uses search with default solr parser. It would match only on
+        # `text`, so we're appending all other field values into `text`, to match on it too.
+        result['text'] += pformat(result.values())
         return result
 
     @classmethod


Mime
View raw message