[wdmmg-dev] changes to the solr and entry schema

Carsten Senger senger at rehfisch.de
Wed Jun 8 12:38:24 UTC 2011


While I implemented <http://trac.openspending.org/ticket/115> I had to
change the solr schema and the data saved on entries (merged into default
in 1295:c191bbc60483).

You have to restart your solr instance with the new schema if you import
new entries and want to index them in solr.

It would be possible to write an update script for the mongodb part, but
there is none yet, so you to reimport the existing entries.


The changes are on entries in mongodb:

* removed old .classifiers - array of [taxonomy, <classifier name>] arrays.
* renamed .classifier_ids to .classifiers (array of ObjectIds)
* added .entities property - (array of ObjectIds)


...in solr:

* .classifiers will be indexed as classifiers in solr (same as before)
* .entities will be indexed as 'entities' in solr. This required to declare
  it as a multi valued string field.

Solr will not index new entries unless 'entities' is a multi valued string
field in it's schema. You will get an 400 Bad Request Exception from pysolr
in this case.

..Carsten




More information about the openspending-dev mailing list