Skip to content

Commit

Permalink
Merge pull request #3210 from ckan/3204-remove-simple_search
Browse files Browse the repository at this point in the history
Remove unsupported simple search
  • Loading branch information
wardi committed Aug 19, 2016
2 parents e26bf56 + d970bb9 commit c0a997d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 111 deletions.
2 changes: 0 additions & 2 deletions ckan/config/deployment.ini_tmpl
Expand Up @@ -78,8 +78,6 @@ ckan.auth.roles_that_cascade_to_sub_groups = admin
ckan.site_id = default
#solr_url = http://127.0.0.1:8983/solr

#ckan.simple_search = 1


## CORS Settings

Expand Down
21 changes: 4 additions & 17 deletions ckan/lib/search/__init__.py
Expand Up @@ -7,7 +7,6 @@
import xml.dom.minidom
import urllib2

from ckan.common import config
from paste.deploy.converters import asbool

import ckan.model as model
Expand All @@ -23,7 +22,6 @@
log = logging.getLogger(__name__)



def text_traceback():
with warnings.catch_warnings():
warnings.simplefilter("ignore")
Expand All @@ -32,7 +30,6 @@ def text_traceback():
).strip()
return res

SIMPLE_SEARCH = asbool(config.get('ckan.simple_search', False))

SUPPORTED_SCHEMA_VERSIONS = ['2.3']

Expand Down Expand Up @@ -60,11 +57,6 @@ def text_traceback():

SOLR_SCHEMA_FILE_OFFSET = '/admin/file/?file=schema.xml'

if SIMPLE_SEARCH:
import sql as sql
_INDICES['package'] = NoopSearchIndex
_QUERIES['package'] = sql.PackageSearchQuery


def _normalize_type(_type):
if isinstance(_type, model.domain_object.DomainObject):
Expand Down Expand Up @@ -219,6 +211,7 @@ def commit():
package_index.commit()
log.info('Commited pending changes on the search index')


def check():
package_query = query_for(model.Package)

Expand Down Expand Up @@ -249,10 +242,9 @@ def clear(package_reference):


def clear_all():
if not SIMPLE_SEARCH:
package_index = index_for(model.Package)
log.debug("Clearing search index...")
package_index.clear()
package_index = index_for(model.Package)
log.debug("Clearing search index...")
package_index.clear()


def check_solr_schema_version(schema_file=None):
Expand All @@ -276,11 +268,6 @@ def check_solr_schema_version(schema_file=None):
be only used for testing purposes (Default is None)
'''


if SIMPLE_SEARCH:
# Not using the SOLR search backend
return False

if not is_available():
# Something is wrong with the SOLR server
log.warn('Problems were found while connecting to the SOLR server')
Expand Down
42 changes: 0 additions & 42 deletions ckan/lib/search/sql.py

This file was deleted.

37 changes: 0 additions & 37 deletions ckan/tests/legacy/lib/test_simple_search.py

This file was deleted.

13 changes: 0 additions & 13 deletions doc/maintaining/configuration.rst
Expand Up @@ -581,19 +581,6 @@ a single CKAN instance then this can be ignored.

Note, if you change this value, you need to rebuild the search index.

.. _ckan.simple_search:

ckan.simple_search
^^^^^^^^^^^^^^^^^^

Example::

ckan.simple_search = true

Default value: ``false``

Switching this on tells CKAN search functionality to just query the database, (rather than using Solr). In this setup, search is crude and limited, e.g. no full-text search, no faceting, etc. However, this might be very useful for getting up and running quickly with CKAN.

.. _solr_url:

solr_url
Expand Down

0 comments on commit c0a997d

Please sign in to comment.