allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [20/40] git commit: [#2835] ticket:288 Preserve old indexation logic for tickets
Date Mon, 01 Apr 2013 14:27:39 GMT
[#2835] ticket:288 Preserve old indexation logic for tickets


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

Branch: refs/heads/cj/5963
Commit: fa1d3affa3a0126028330b6c4fc27b2107de58c7
Parents: 88d7b82
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Mar 8 13:00:39 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Tue Mar 26 20:57:38 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/search.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fa1d3aff/Allura/allura/lib/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/search.py b/Allura/allura/lib/search.py
index 17fbf57..a6587f1 100644
--- a/Allura/allura/lib/search.py
+++ b/Allura/allura/lib/search.py
@@ -1,15 +1,12 @@
 import re
 import socket
-import cPickle as pickle
 from logging import getLogger
 from pprint import pformat
-from itertools import islice, chain
 
 import markdown
 from pylons import tmpl_context as c, app_globals as g
 from pysolr import SolrError
 
-from . import helpers as h
 from .markdown_extensions import ForgeExtension
 
 log = getLogger(__name__)
@@ -21,6 +18,10 @@ 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):


Mime
View raw message