From d2a6c4b5534cb17ab890e0d6c683a662a10ffbf0 Mon Sep 17 00:00:00 2001 From: Vitor Baptista Date: Tue, 22 Jul 2014 11:19:32 -0300 Subject: [PATCH] [#1838] Adds docs --- ckan/config/deployment.ini_tmpl | 3 ++- ckanext/datastore/logic/action.py | 6 ++++-- doc/maintaining/configuration.rst | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ckan/config/deployment.ini_tmpl b/ckan/config/deployment.ini_tmpl index 7f8cda8c7e7..a94b8b175e3 100644 --- a/ckan/config/deployment.ini_tmpl +++ b/ckan/config/deployment.ini_tmpl @@ -48,6 +48,8 @@ sqlalchemy.url = postgresql://ckan_default:pass@localhost/ckan_default #ckan.datastore.write_url = postgresql://ckan_default:pass@localhost/datastore_default #ckan.datastore.read_url = postgresql://datastore_default:pass@localhost/datastore_default +# Default Postgres' full-text search index language +ckan.datastore.default_fts_lang = english ## Site Settings @@ -110,7 +112,6 @@ ckan.locale_order = en pt_BR ja it cs_CZ ca es fr el sv sr sr@latin no sk fi ru ckan.locales_offered = ckan.locales_filtered_out = en_GB - ## Feeds Settings ckan.feeds.authority_name = diff --git a/ckanext/datastore/logic/action.py b/ckanext/datastore/logic/action.py index 7b50465c859..435842592fa 100644 --- a/ckanext/datastore/logic/action.py +++ b/ckanext/datastore/logic/action.py @@ -274,8 +274,10 @@ def datastore_search(context, data_dict): :type resource_id: string :param filters: matching conditions to select, e.g {"key1": "a", "key2": "b"} (optional) :type filters: dictionary - :param q: full text query (optional) - :type q: string + :param q: full text query. If it's a string, it'll search on all fields on + each row. If it's a dictionary as {"key1": "a", "key2": "b"}, + it'll search on each specific field (optional) + :type q: string or dictionary :param distinct: return only distinct rows (optional, default: false) :type distinct: bool :param plain: treat as plain text query (optional, default: true) diff --git a/doc/maintaining/configuration.rst b/doc/maintaining/configuration.rst index d6ad311d7f1..a154348c3fe 100644 --- a/doc/maintaining/configuration.rst +++ b/doc/maintaining/configuration.rst @@ -108,6 +108,21 @@ with read permissions only. The format is the same as in :ref:`sqlalchemy.url`. .. end_config-datastore-urls +.. _ckan.datastore.default_fts_lang: + +ckan.datastore.default_fts_lang +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Example:: + + ckan.datastore.default_fts_lang = english + +This can be ignored if you're not using the :doc:`datastore`. + +The default language used when creating full-text search indexes and querying +them. If this value isn't set, it'll default to "english". It can be +overwritten by the user by passing the "lang" parameter to "datastore_search" +and "datastore_create". Site Settings -------------