Skip to main content

No project description provided

Project description

ckanext-search-tweaks

Set of tools providing control over search results, sorting, etc.

Requirements

Compatibility with core CKAN versions:

CKAN version Compatible?
2.8 and earlier no
2.9 yes

Installation

To install ckanext-search-tweaks:

  1. Activate your CKAN virtual environment, for example:

     . /usr/lib/ckan/default/bin/activate
    
  2. Install it on the virtualenv

     pip install ckanext-search-tweaks
    
  3. Add search_tweaks to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/ckan.ini).

  4. Restart CKAN.

Config settings

# Which backend to use in order to collect information about dataset
# relevance for the particular search query. Possible values are:
# "redis-permanent", "redis-daily"
# (optional, default: redis-daily).
ckanext.search_tweaks.search_relevance.backend = redis-permanent

# How long(in days) information about dataset visits will be stored in order to
# update relevance of dataset in search query.
# (optional, default: 90).
ckanext.search_tweaks.search_relevance.daily.age = 90

# Solr boost function with $field placeholder that will be replaced by
# the correspoinding field name
# (optional, default: "scale(def($field,0),0,2)").
ckanext.search_tweaks.relevance.boost_function = recip($field,1,1000,1000)

# Prefix of the numeric field defined in Solr schema. This field will hold
# dataset's relevance for the given query.
# (optional, default: query_relevance_).
ckanext.search_tweaks.relevance.field_prefix = custom_score_

Developer installation

To install ckanext-search-tweaks for development, activate your CKAN virtualenv and do:

git clone https://github.com/DataShades/ckanext-search-tweaks.git
cd ckanext-search-tweaks
python setup.py develop
pip install -r dev-requirements.txt

Tests

To run the tests, do:

pytest --ckan-ini=test.ini ckanext/search_tweaks/tests

License

AGPL

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext-search-tweaks-0.0.1.tar.gz (22.9 kB view hashes)

Uploaded Source

Built Distribution

ckanext_search_tweaks-0.0.1-py3-none-any.whl (23.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page