This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Configuration
ryanb edited this page Aug 17, 2011
·
1 revision
When running the rails g xapit:install
command it will generate a configuration file in config/xapit.yml
. Each Rails environment can have a different set of configuration options. Here is a list of each option.
-
enabled
determines if Xapit is on initially. Records created while it is disabled will not be indexed automatically. Trying to perform a search will result in aXapit::Disabled
exception. PassXapit.enable
to enable it. Defaults totrue
. -
spelling
causes records to be indexed with spelling terms. Thespelling_suggestion
method will still work when this is disabled, it will just not return any results. Defaults totrue
. -
stemming
specifies which language to be used when stemming. Any language that Xapian supports can be used here. Pass nothing here to disable stemming. Defaults toenglish
. -
database_path
is path to the database file relative to the project root directory. If no database path is specified it will use an in-memory store. Defaults to no path. -
server
is the URL to the Xapit server which can be started with the included rackup file. If you have multiple processes needing to connect to the database (such as in production) it is important to use this server option because only one process can write to the database. If nothing is specified it will use a local database. Defaults to nothing.
In Rails the config/xapit.yml
file is loaded automatically when the app starts. You can reload the configuration at any time by doing Xapit.reload
. It is also possible to load the configuration file manually:
Xapit.reset_config # set to default config options
Xapit.load_config("path/to/xapit.yml", "development")