diff --git a/apps/search/tests/test_client.py b/apps/search/tests/test_client.py index d233e89cb4..8e44a9f80e 100644 --- a/apps/search/tests/test_client.py +++ b/apps/search/tests/test_client.py @@ -256,7 +256,7 @@ class SearchTest(SphinxTestCase): class SearchStatusTest(SphinxTestCase): fixtures = ('base/addon_3615', 'base/addon_5369', 'base/addon_592', 'base/addon_5579', 'base/addon_40', 'search/560618-alpha-sort', - 'base/apps', 'base/category') + 'base/apps', 'base/category', 'addons/persona') def reindex(self): stop_sphinx() @@ -269,6 +269,13 @@ class SearchStatusTest(SphinxTestCase): self.reindex() eq_(len(query('')), 0) + def test_persona_status(self): + Addon.objects.update(status=amo.STATUS_PUBLIC) + eq_(len(pquery('')), 1) + Addon.objects.update(status=amo.STATUS_DISABLED) + self.reindex() + eq_(len(pquery('')), 0) + def test_searchable_status(self): Addon.objects.update(status=amo.STATUS_UNREVIEWED) Addon.objects.filter(id=5579).update(status=amo.STATUS_PUBLIC) diff --git a/configs/sphinx/sphinx.conf b/configs/sphinx/sphinx.conf index e675ae258a..bdd895967f 100755 --- a/configs/sphinx/sphinx.conf +++ b/configs/sphinx/sphinx.conf @@ -301,7 +301,9 @@ source personas OR name.localized_string IS NOT NULL \ OR description.locale IS NOT NULL \ OR description.localized_string IS NOT NULL \ - ) + )\ + AND status IN (4, 8, 9) -- PUBLIC, LITE, LITE_AND_NOMINATED + sql_attr_uint = addon_id sql_attr_uint = locale_ord sql_attr_str2ordinal = locale