Skip to content

Instantly share code, notes, and snippets.

@erochest
Created June 8, 2012 18:41
Show Gist options
  • Save erochest/2897515 to your computer and use it in GitHub Desktop.
Save erochest/2897515 to your computer and use it in GitHub Desktop.
SQL to add a facet to Omeka Solr Search Plugin
SET NAMES 'utf8' COLLATE 'utf8_unicode_ci';
SET @set_name := 'Dublin Core';
SET @element_name := 'Coverage';
SET @label := 'Greeting';
SET @facet := 1;
SET @displayed := 1;
INSERT INTO omeka_solr_search_facets
(element_id, name, label, element_set_id, is_facet, is_displayed)
SELECT e.id, CONCAT(e.id, '_s'), @label, es.id, @facet, @displayed
FROM omeka_element_sets es, omeka_elements e
WHERE es.name=@set_name AND e.name=@element_name AND es.id=e.element_set_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment