Solr

For my projects I use the awesome tool Capistrano for deployment. In a project that uses Solr, I want to update the Solr core as a deployment step if the Solr configuration of that core is changed. After the reload of the configuration I want to do a full import with the Solr Data Import Handler.

If you have a large import then this can take a while. But it is possible to do this without any downtime! The trick is to work with two cores. A “live” core and a “on deck” core. The More >

Solr has by default in the schema.xml the field type “string” available.

<!-- The StrField type is not analyzed, but indexed/stored verbatim. --><fieldTypename="string"class="solr.StrField"sortMissingLast="true"omitNorms="true"/>

With this field type you can search with a string to get an exact match, instead of a contains match that the “text_general” field type will give you. However another difference is that the “text_general” field type is case insensitive by default and “string” is case sensitive.

To perform an case insensitive exact match search, you’ll have to add a custom field type More >

However if you enable them with the solr.StopFilterFactory the stop words still are not removed. This is caused by the “|” pipe characters after each word. Solr wants every word on a new line without anything else. Also replacement of | to # doesn’t work. This problem can be hard to discover if you expect that information provided by the Solr website should just work.