Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Mayer authored and Florian Mayer committed Jul 10, 2017
2 parents d415b0d + 73a4599 commit 6283ce8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
10 changes: 10 additions & 0 deletions ckan/lib/helpers.py
Expand Up @@ -2342,6 +2342,15 @@ def mail_to(email_address, name):
return html


@core_helper
def radio(selected, id, checked):
if checked:
return literal((u'<input checked="checked" id="%s_%s" name="%s" \
value="%s" type="radio">') % (selected, id, selected, id))
return literal(('<input id="%s_%s" name="%s" \
value="%s" type="radio">') % (selected, id, selected, id))


core_helper(flash, name='flash')
core_helper(localised_number)
core_helper(localised_SI_number)
Expand All @@ -2362,6 +2371,7 @@ def mail_to(email_address, name):
core_helper(urlencode)
core_helper(clean_html, name='clean_html')


def load_plugin_helpers():
"""
(Re)loads the list of helpers provided by plugins.
Expand Down
24 changes: 17 additions & 7 deletions doc/contributing/test.rst
Expand Up @@ -71,12 +71,13 @@ Configure Solr Multi-core
~~~~~~~~~~~~~~~~~~~~~~~~~

The tests assume that Solr is configured 'multi-core', whereas the default
Solr set-up is often 'single-core'. You can ask Solr how many cores it has
configured::
Solr set-up is often 'single-core'. You can ask Solr for its cores status::

curl -s 'http://127.0.0.1:8983/solr/admin/cores?action=STATUS' |python -c 'import sys;import xml.dom.minidom;s=sys.stdin.read();print xml.dom.minidom.parseString(s).toprettyxml()'

You can also tell from your ckan config::
Each core will be within a child from the ``<lst name="status"`` element, and contain a ``<str name="instanceDir">`` element.

You can also tell from your ckan config (assuming ckan is working)::

grep solr_url /etc/ckan/default/production.ini
# single-core: solr_url = http://127.0.0.1:8983/solr
Expand All @@ -92,13 +93,22 @@ To enable multi-core:

sudo cp -r /usr/share/solr/ /etc/solr/ckan

3. Configure Solr with the new core::
3. Find your solr.xml. It is in the Solr Home directory given by this command::

curl -s 'http://127.0.0.1:8983/solr/admin/' | grep SolrHome

4. Configure Solr with the new core by editing ``solr.xml``. The 'cores' section will have one 'core' in it already and needs the second one 'ckan' added so it looks like this::

<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
<core name="ckan" instanceDir="/etc/solr/ckan" />
</cores>

curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=ckan&instanceDir=/etc/solr/ckan'
5. Restart Solr by restarting Jetty (or Tomcat)::

If successful the status should be 0 - some XML containing: ``<int name="status">0</int>``
sudo service jetty restart

4. Edit your main ckan config (e.g. |development.ini|) and adjust the solr_url to match::
6. Edit your main ckan config (e.g. |development.ini|) and adjust the solr_url to match::

solr_url = http://127.0.0.1:8983/solr/ckan

Expand Down

0 comments on commit 6283ce8

Please sign in to comment.