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 2014/05/09 23:42:38 UTC
[18/18] git commit: [#7257] update fields indexed in solr for projects
[#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/fc5f4606
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fc5f4606
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fc5f4606
Branch: refs/heads/db/7257
Commit: fc5f46062c8d6377312002461feb9fe9d7955919
Parents: 6080f11
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri May 9 19:45:25 2014 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 9 21:41:48 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/fc5f4606/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 3b060ea..3182ded 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -1011,19 +1011,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/fc5f4606/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