Sha256: b8ff0299ddadbe5bbddc142ded2fa756166139e24ac1f1cdbee294fa1d05750a

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

By default, Documentation uses a very very simple search which uses a LIKE query on your database. As this method is far from ideal, Documentation allows additional search backends to be created. 

## Elasticsearch

The recommended method of indexing & searching data is to use Elasticsearch. A module is provided for this [on GitHub](https://github.com/adamcooke/documentation-elasticsearch) and can be installed by following the instructions on the repo's README page.

## Creating your own search backend

To create your own backend, create a new class which inherits from `Documentation::Searchers::Abstract`. This class must confirm to the protocol outlined in this [abstract.rb](https://github.com/adamcooke/documentation/blob/master/lib/documentation/searchers/abstract.rb) file.

## Using your custom backend

Once you have created a backend, you should tell Documentation to use it. Just add the following to your `config/initializers/documentation.rb` file.

```ruby
Documentation.config.searcher = MyCustomSearcher.new
```

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
documentation-1.0.9 doc/developers-guide/search-backends.md
documentation-1.0.8 doc/developers-guide/search-backends.md
documentation-1.0.7 doc/developers-guide/search-backends.md
documentation-1.0.6 doc/developers-guide/search-backends.md
documentation-1.0.5 doc/developers-guide/search-backends.md
documentation-1.0.4 doc/developers-guide/search-backends.md
documentation-1.0.3 doc/developers-guide/search-backends.md