Skip to content

Solr development

Ilya Sytchev edited this page Nov 24, 2015 · 8 revisions

Table of contents:


Admin interface

http://192.168.50.50:8983/solr/

Location

Search indexes are grouped by files, e.g. search_indexes.py into cores (collection of documents) for every app. E.g. data set and project related indexes are in core/search_indexes.py.

Updating indexes

There are two slightly different steps to take depending on whether the index model has changed or not.

Identical model but new data

$ ./manage.py update_index --using=<core> --batch-size=25

<core> represents the Django app in which the search_indexes.py file is located. update_index can also just update a certain document types, e.g. to only update data sets but not projects, use the following call:

$ ./manage.py update_index core.DataSet --batch-size=25

Updated index model

When you edited the index you need to take the following three steps.

  1. $ ./manage.py build_solr_schema --using=core > ./solr/core/conf/schema.xml
  2. $ sudo service solr restart
  3. $ ./manage.py rebuild_index --using=core --batch-size=25

Troubleshooting:

  • You may need to increase the memory for the virtual machine to prevent accidental memory issues.
  • Another option to keep the memory usage under control is to decrease the --batch-size.

Update Solr

After updating Solr it's best practice to re-index everything because the version of Lucene will be updated too and these will not be incorporated until the index has been refreshed.

Start stop restart Solr

To follow best practice, Solr is running as a service under production settings.

$ sudo service solr (start|stop|restart|status)
Clone this wiki locally