[ckan-changes] commit/ckan: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Nov 9 14:30:25 UTC 2011
2 new commits in ckan:
https://bitbucket.org/okfn/ckan/changeset/e9646518e9b6/
changeset: e9646518e9b6
user: dread
date: 2011-11-09 12:51:52
summary: [lib][xs]: Logging for search queries.
affected #: 1 file
diff -r a1bd176fe3758608185f72ecbc6bf7858eb957b9 -r e9646518e9b6d0b4576052510b126d79060d0fff ckan/lib/search/query.py
--- a/ckan/lib/search/query.py
+++ b/ckan/lib/search/query.py
@@ -274,6 +274,7 @@
conn = make_connection()
try:
+ log.debug('Package query: %r' % query)
data = json.loads(conn.raw_query(**query))
response = data['response']
self.count = response.get('numFound', 0)
https://bitbucket.org/okfn/ckan/changeset/138c5daf7765/
changeset: 138c5daf7765
user: dread
date: 2011-11-09 15:30:13
summary: [model,migration]: #1454 Postgres search code/data removed.
affected #: 4 files
diff -r e9646518e9b6d0b4576052510b126d79060d0fff -r 138c5daf7765a4cebaa679aa925defdd2c1e7f3e ckan/lib/create_test_data.py
--- a/ckan/lib/create_test_data.py
+++ b/ckan/lib/create_test_data.py
@@ -481,12 +481,6 @@
'''Purges packages etc. that were created by this class.'''
import ckan.model as model
for pkg_name in cls.pkg_names:
- pkg = model.Package.by_name(unicode(pkg_name))
- if pkg:
- sql = "DELETE FROM package_search WHERE package_id='%s'" % pkg.id
- model.Session.execute(sql)
- model.repo.commit_and_remove()
- for pkg_name in cls.pkg_names:
model.Session().autoflush = False
pkg = model.Package.by_name(unicode(pkg_name))
if pkg:
diff -r e9646518e9b6d0b4576052510b126d79060d0fff -r 138c5daf7765a4cebaa679aa925defdd2c1e7f3e ckan/model/__init__.py
--- a/ckan/model/__init__.py
+++ b/ckan/model/__init__.py
@@ -17,7 +17,6 @@
from authorization_group import *
from group import *
from group_extra import *
-from search_index import *
from authz import *
from package_extra import *
from resource import *
diff -r e9646518e9b6d0b4576052510b126d79060d0fff -r 138c5daf7765a4cebaa679aa925defdd2c1e7f3e ckan/model/package_mapping.py
--- a/ckan/model/package_mapping.py
+++ b/ckan/model/package_mapping.py
@@ -3,7 +3,6 @@
import tag
from core import *
from package import *
-import search_index
from ckan.model import extension
__all__ = ['PackageRevision']
@@ -19,9 +18,6 @@
'package_tags':relation(tag.PackageTag, backref='package',
cascade='all, delete', #, delete-orphan',
),
- 'package_search':relation(search_index.PackageSearch,
- cascade='all, delete', #, delete-orphan',
- ),
},
order_by=package_table.c.name,
extension=[vdm.sqlalchemy.Revisioner(package_revision_table),
diff -r e9646518e9b6d0b4576052510b126d79060d0fff -r 138c5daf7765a4cebaa679aa925defdd2c1e7f3e ckan/model/search_index.py
--- a/ckan/model/search_index.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import sqlalchemy
-
-from meta import Table, Column, UnicodeText, ForeignKey, mapper, metadata
-
-__all__ = ['package_search_table', 'PackageSearch']
-
-def setup_db(event, schema_item, engine):
- sql = 'ALTER TABLE package_search ADD COLUMN search_vector tsvector'
- res = engine.execute(sql)
- res.close()
-
-package_search_table = Table('package_search', metadata,
- Column('package_id', UnicodeText, ForeignKey('package.id'), primary_key=True),
- )
-
-class PackageSearch(object):
- pass
-# We need this mapper so that Package can delete orphaned package_search rows
-mapper(PackageSearch, package_search_table, properties={})
-
-package_search_table.append_ddl_listener('after-create', setup_db)
-
-
Repository URL: https://bitbucket.org/okfn/ckan/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the ckan-changes
mailing list