allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [19/20] git commit: [#7257] update fields indexed in solr for projects
Date Wed, 21 May 2014 14:45:07 GMT
[#7257] update fields indexed in solr for projects

* category_id is very old and not used
* use ProjectRegistrationProvider to get project create/register time
* add flags for nbhd proj, and root (aka not subproject)
* add external homepage
* do exact match on project and nbhd names


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

Branch: refs/heads/master
Commit: 3662725158a12f71dca61aee4d36f1170ac06436
Parents: 3760cd9
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Fri May 9 19:45:25 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed May 21 14:44:22 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/project.py            | 13 ++++++++-----
 Allura/allura/tests/model/test_project.py |  1 -
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/36627251/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 45bb551..b7ab1f7 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -1042,19 +1042,22 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
                       deleted_b=self.deleted,
                       # Not analyzed fields
                       private_b=_private,
-                      category_id_s=str(self.category_id or ''),
                       neighborhood_id_s=str(self.neighborhood_id),
                       url_s=h.absurl(self.url()),
-                      created_dt=self._id.generation_time,
+                      is_root_b=self.is_root,
+                      is_nbhd_project_b=self.is_nbhd_project,
+                      registration_dt=plugin.ProjectRegistrationProvider.get().registration_date(self),
                       last_updated_dt=self.last_updated,
                       removal_changed_date_dt=self.removal_changed_date,
+                      name_s=self.name,
+                      shortname_s=self.shortname,
+                      neighborhood_name_s=self.neighborhood.name,
+                      external_homepage_s=self.external_homepage,
                       # Analyzed fields
-                      name_t=self.name,
-                      shortname_t=self.shortname,
                       short_description_t=self.short_description,
                       labels_t=' '.join(self.labels),
                       summary_t=self.summary,
-                      neighborhood_name_t=self.neighborhood.name)
+                    )
         if self.category:
             fields.update(category_name_t=self.category.name,
                           category_description_t=self.category.description)

http://git-wip-us.apache.org/repos/asf/allura/blob/36627251/Allura/allura/tests/model/test_project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_project.py b/Allura/allura/tests/model/test_project.py
index 2867327..20aa059 100644
--- a/Allura/allura/tests/model/test_project.py
+++ b/Allura/allura/tests/model/test_project.py
@@ -104,7 +104,6 @@ def test_project_index():
     assert 'deleted_b' in idx
     assert 'private_b' in idx
     assert 'neighborhood_id_s' in idx
-    assert 'category_id_s' in idx
     assert 'short_description_t' in idx
     assert 'url_s' in idx
 


Mime
View raw message