You are here

function hook_apachesolr_confgen_schema_alter in Apache Solr Config Generator 7

Same name and namespace in other branches
  1. 6 apachesolr_confgen.api.php \hook_apachesolr_confgen_schema_alter()

Alter the schema.xml using QueryPath.

Parameters

object $qp: A querypath object representing schema.xml @see querypath.module

string $solr_version: switch to target different solr versions, currently '1.4.x', '3.5.x' and '4.5.x'

See also

http://querypath.org/

File

./apachesolr_confgen.api.php, line 18
Exposed Hooks in 7.x:

Code

function hook_apachesolr_confgen_schema_alter($qp, $solr_version) {
  $language = 'en';
  $qp
    ->find(':root')
    ->xpath("types/fieldType[@name='text']//filter[@class='solr.SynonymFilterFactory']")
    ->attr('synonyms', 'synonyms_' . $language . '.txt')
    ->attr('ignoreCase', variable_get('apachesolr_multilingual_ignoreCase_synonyms_' . $language, 1));
}