diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 10ecc8fcce2..d0eeaa96d98 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -12,7 +12,9 @@ v2.2 API changes and deprecations: - +* The Solr schema file is now always named ``schema.xml`` regardless of the + CKAN version. Old schema files have been kept for backwards compatibility + but users are encouraged to point to the new unified one. * The `ckan.api_url` has been completely removed and it can no longer be used * The edit() and after_update() methods of IPackageController plugins are now called when updating a resource using the web frontend or the diff --git a/bin/travis-run-tests b/bin/travis-run-tests index 28ddd58e04b..5d60ea0646d 100755 --- a/bin/travis-run-tests +++ b/bin/travis-run-tests @@ -2,8 +2,7 @@ # Configure Solr echo "NO_START=0\nJETTY_HOST=127.0.0.1\nJETTY_PORT=8983\nJAVA_HOME=$JAVA_HOME" | sudo tee /etc/default/jetty -# FIXME the solr schema cannot be hardcoded as it is dependent on the ckan version -sudo cp ckan/config/solr/schema-2.0.xml /etc/solr/conf/schema.xml +sudo cp ckan/config/solr/schema.xml /etc/solr/conf/schema.xml sudo service jetty restart # Run mocha front-end tests diff --git a/ckan/config/solr/CHANGELOG.txt b/ckan/config/solr/CHANGELOG.txt deleted file mode 100644 index 769c6b53735..00000000000 --- a/ckan/config/solr/CHANGELOG.txt +++ /dev/null @@ -1,29 +0,0 @@ -CKAN SOLR schemas changelog -=========================== - -v2.0 - (ckan>=2.0) --------------------- -* Add _version_ field to make it compatible with solr 4.0 -* Remove stopwords -* Add dataset_type field. -* Add *_date autofield. - -v1.4 - (ckan>=1.7) --------------------- -* Add Ascii folding filter to text fields. -* Add capacity field for public, private access. -* Add title_string so you can sort alphabetically on title. -* Fields related to analytics, access and view counts. -* Add data_dict field for the whole package_dict. -* Add vocab_* dynamic field so it is possible to facet by vocabulary tags -* Add copyField for text with source vocab_* - -v1.3 - (ckan>=1.5.1) --------------------- -* Use the index_id (hash of dataset id + site_id) as uniqueKey (#1430) -* Store extras (#1455) -* Store dataset creation and modification date (#191) - -v1.2 - (ckan<=1.5) --------------------- -* Original version diff --git a/ckan/config/solr/README.txt b/ckan/config/solr/README.txt index 9a3bccebfac..d8fcff40f42 100644 --- a/ckan/config/solr/README.txt +++ b/ckan/config/solr/README.txt @@ -1,30 +1,12 @@ -CKAN SOLR schemas -================= +CKAN Solr schema +================ -This folder contains the latest and previous versions of the SOLR XML -schema files used by CKAN. These can be use on the SOLR server to -override the default SOLR schema. Please note that not all schemas are -backwards compatible with old CKAN versions. Check the CHANGELOG.txt file -in this same folder to check which version of the schema should you use -depending on the CKAN version you are using. +This folder contains the Solr schema file used by CKAN (schema.xml). -Developers, when pushing changes to the SOLR schema: +Starting from 2.2 this is the only file that should be used by users and +modified by devs. The rest of files (schema-{version}.xml) are kept for +backwards compatibility purposes and should not be used, as they might be +removed in future versions. -* Note that updates on the schema are only release based, i.e. all changes - in the schema between releases will be part of the same new version of - the schema. - -* Name the new version of the file using the following convention:: - - schema-.xml - -* Update the `version` attribute of the `schema` tag in the new file:: - - - -* Update the SUPPORTED_SCHEMA_VERSIONS list in `ckan/lib/search/__init__.py` - Consider if the changes introduced are or are not compatible with - previous schema versions. - -* Update the CHANGELOG.txt file with the new version, the CKAN version - required and changes made to the schema. +When upgrading CKAN, always check the CHANGELOG on each release to see if +you need to update the schema file and reindex your datasets. diff --git a/ckan/config/solr/schema-1.2.xml b/ckan/config/solr/schema-1.2.xml index 2fb41dd96a1..4f9b11a580b 100644 --- a/ckan/config/solr/schema-1.2.xml +++ b/ckan/config/solr/schema-1.2.xml @@ -1,4 +1,12 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +index_id +text + + + + + + + + + + + + + + + + + + + + + diff --git a/ckan/tests/lib/test_solr_schema_version.py b/ckan/tests/lib/test_solr_schema_version.py index 2dbc06f5bc7..344603274c4 100644 --- a/ckan/tests/lib/test_solr_schema_version.py +++ b/ckan/tests/lib/test_solr_schema_version.py @@ -1,5 +1,4 @@ import os -from pylons import config from ckan.tests import TestController class TestSolrSchemaVersionCheck(TestController): @@ -11,11 +10,7 @@ def setup_class(cls): def _get_current_schema(self): - from ckan.lib.search import SUPPORTED_SCHEMA_VERSIONS - - current_version = sorted(SUPPORTED_SCHEMA_VERSIONS).pop() - - current_schema = os.path.join(self.root_dir,'..','..','config','solr','schema-%s.xml' % current_version) + current_schema = os.path.join(self.root_dir,'..','..','config','solr','schema.xml') return current_schema diff --git a/doc/appendices/solr-multicore.rst b/doc/appendices/solr-multicore.rst index 92ebcb6fb28..0d81ecd06fa 100644 --- a/doc/appendices/solr-multicore.rst +++ b/doc/appendices/solr-multicore.rst @@ -9,7 +9,7 @@ same machine. Each configuration is called a Solr *core*. Having multiple cores is useful when you want different applications or different versions of CKAN to share the same Solr instance, each application can have its own Solr core so each can use a different ``schema.xml`` file. This is necessary, for example, -if you want to CKAN instances to share the same |solr| server and those two +if you want two CKAN instances to share the same |solr| server and those two instances are running different versions of CKAN that require differemt ``schema.xml`` files, or if the two instances have different |solr| schema customizations. @@ -57,7 +57,7 @@ core for it, see :ref:`creating another solr core`. CKAN's ``schema.xml`` file:: sudo mv /etc/solr/ckan_default/conf/schema.xml /etc/solr/ckan_default/conf/schema.xml.bak - sudo ln -s /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema-2.0.xml /etc/solr/ckan_default/conf/schema.xml + sudo ln -s /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema.xml /etc/solr/ckan_default/conf/schema.xml #. Edit ``/etc/solr/ckan_default/conf/solrconfig.xml`` and change the ```` tag to this:: @@ -116,7 +116,7 @@ In this example we'll assume that: #. You've installed a second instance of CKAN in a second virtual environment at /usr/lib/ckan/|ckan|, and now want to setup a second Solr core for it. -You can ofcourse follow these instructions again to setup further Solr cores. +You can of course follow these instructions again to setup further Solr cores. #. Add the core to ``/usr/share/solr/solr.xml``. This file should now list two cores. For example: @@ -154,7 +154,7 @@ You can ofcourse follow these instructions again to setup further Solr cores. .. parsed-literal:: sudo rm /etc/solr/|core|/conf/schema.xml - sudo ln -s /usr/lib/ckan/|ckan|/src/ckan/ckan/config/solr/schema-2.0.xml /etc/solr/|core|/conf/schema.xml + sudo ln -s /usr/lib/ckan/|ckan|/src/ckan/ckan/config/solr/schema.xml /etc/solr/|core|/conf/schema.xml #. Create the /usr/share/solr/|core| directory and put a symlink to the ``conf`` directory in it: diff --git a/doc/install-from-source.rst b/doc/install-from-source.rst index e66d49515a3..f34449f9105 100644 --- a/doc/install-from-source.rst +++ b/doc/install-from-source.rst @@ -253,18 +253,13 @@ installed, we need to install and configure Solr. JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386/ -#. Replace the default ``schema.xml`` file with a symlink to your CKAN schema - file. - There are multiple versions of CKAN's schema file in - |virtualenv|/src/ckan/ckan/config/solr/. Use the newest schema file whose version - number is the same as or older than the version of CKAN you're using. For - example, if you're using CKAN 2.1.1 then you would use the ``schema-2.0.xml`` - file (because there is no ``schema-2.1.xml`` file): +#. Replace the default ``schema.xml`` file with a symlink to the CKAN schema + file included in the sources. .. parsed-literal:: sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak - sudo ln -s |virtualenv|/src/ckan/ckan/config/solr/schema-2.0.xml /etc/solr/conf/schema.xml + sudo ln -s |virtualenv|/src/ckan/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml Now restart Solr: diff --git a/doc/release-process.rst b/doc/release-process.rst index 2d0046fbd05..4b427d2cf03 100644 --- a/doc/release-process.rst +++ b/doc/release-process.rst @@ -12,7 +12,7 @@ Doing a Beta Release Beta releases are branched off a certain point in master and will eventually become stable releases. -1. Create a new release branch:: +#. Create a new release branch:: git checkout -b release-v1.8 @@ -26,11 +26,22 @@ become stable releases. You will probably need to update the same file on master to increase the version number, in this case ending with an *a* (for alpha). -2. During the beta process, all changes to the release branch must be +#. Check if there have been changes in the |solr| schema at + ``ckan/config/solr/schema.xml``, and if so: + + * Update the ``version`` attribute of the ``schema`` with the current CKAN + version:: + + + + * Update the ``SUPPORTED_SCHEMA_VERSIONS`` list in + ``ckan/lib/search/__init__.py`` + +#. During the beta process, all changes to the release branch must be cherry-picked from master (or merged from special branches based on the release branch if the original branch was not compatible). -3. As in the master branch, if some commits involving CSS changes are +#. As in the master branch, if some commits involving CSS changes are cherry-picked from master, the less compiling command needs to be run on the release branch. This will update the ``main.css`` file:: @@ -40,10 +51,10 @@ become stable releases. There will be a final front-end build before the actual release. -4. The beta staging site (http://beta.ckan.org, currently on s084) should be +#. The beta staging site (http://beta.ckan.org, currently on s084) should be updated regularly to allow user testing. -5. Once the translation freeze is in place (ie no changes to the translatable +#. Once the translation freeze is in place (ie no changes to the translatable strings are allowed), strings need to be extracted and uploaded to Transifex_: diff --git a/doc/upgrade-package-to-minor-release.rst b/doc/upgrade-package-to-minor-release.rst index cf2f5fe7335..c7754352589 100644 --- a/doc/upgrade-package-to-minor-release.rst +++ b/doc/upgrade-package-to-minor-release.rst @@ -74,22 +74,7 @@ respectively. command. #. If there have been changes in the Solr schema (check the :doc:`changelog` - to find out) you need to update your Solr schema symlink. - - When :ref:`setting up solr` you created a symlink - ``/etc/solr/conf/schema.xml`` linking to a CKAN Solr schema file such as - |virtualenv|/src/ckan/ckan/config/solr/schema-2.0.xml. This symlink - should be updated to point to the latest schema file in - |virtualenv|/src/ckan/ckan/config/solr/, if it doesn't already. - - For example, to update the symlink: - - .. parsed-literal:: - - sudo rm /etc/solr/conf/schema.xml - sudo ln -s |virtualenv|/src/ckan/ckan/config/solr/schema-2.0.xml /etc/solr/conf/schema.xml - - You will need to restart Jetty for the changes to take effect: + to find out) you need to restart Jetty for the changes to take effect: .. parsed-literal:: diff --git a/doc/upgrade-source.rst b/doc/upgrade-source.rst index 539b96dcb62..82fac09ed5f 100644 --- a/doc/upgrade-source.rst +++ b/doc/upgrade-source.rst @@ -43,23 +43,8 @@ CKAN release you're upgrading to: python setup.py develop -#. If you are upgrading to a new :ref:`major release ` you need to - update your Solr schema symlink. - - When :ref:`setting up solr` you created a symlink - ``/etc/solr/conf/schema.xml`` linking to a CKAN Solr schema file such as - |virtualenv|/src/ckan/ckan/config/solr/schema-2.0.xml. This symlink - should be updated to point to the latest schema file in - |virtualenv|/src/ckan/ckan/config/solr/, if it doesn't already. - - For example, to update the symlink: - - .. parsed-literal:: - - sudo rm /etc/solr/conf/schema.xml - sudo ln -s |virtualenv|/src/ckan/ckan/config/solr/schema-2.0.xml /etc/solr/conf/schema.xml - - You will need to restart Jetty for the changes to take effect: +#. If there have been changes in the Solr schema (check the :doc:`changelog` + to find out) you need to restart Jetty for the changes to take effect: .. parsed-literal::