Last updated by maurice 5 years ago

Searchable Plugin - Configuration

By default the plugin configures the search engine for you.

If you want to override any of these settings, or simply prefer the settings declared in your own codebase rather than within the plugin's, install the configuration file:

grails install-searchable-config

from your project dir, then edit the generated file, @myproject/grails-app/conf/Searchable.groovy@.

It uses the same tech as Config.grooy so it supports per-environment config.

The name and syntax of this file has chaged in 0.5; it was previously called @SearchableConfiguration.groovy@.

You can migrate your settings by just installing the newer config file and copy/pasting across.

With this file you can configure such things as

  • The index location (eg, file-system or RAM index)
  • Default search options (max, escape, reload, etc)
  • Default property mapping exclusions and formats
  • Enabling/disabling the bulk index and mirror changes features
  • Compass settings
See the docs in the config file itself for more.

Spring beans

Since 0.5.1, custom analyzers and converters can be defined as Spring beans.

Native Compass XML config

Since 0.4 the plugin also looks for a native Compass XML configuration file at the root of the classpath called @compass.cfg.xml@. If this file is present, Compass is configured with the settings defined in it, in addition to any that may be defined by the plugin's own @Searchable.groovy@.

See the XML configuration section of the Compass manual for more info and examples.