Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
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.
enableddetermines if Xapit is on initially. Records created while it is disabled will not be indexed automatically. Trying to perform a search will result in a
Xapit.enableto enable it. Defaults to
spellingcauses records to be indexed with spelling terms. The
spelling_suggestionmethod will still work when this is disabled, it will just not return any results. Defaults to
stemmingspecifies which language to be used when stemming. Any language that Xapian supports can be used here. Pass nothing here to disable stemming. Defaults to
database_pathis 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.
serveris 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")