0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
DEPRECATED - Mediator for apps that want their content to be in the search index
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
= 1.1.0

Runtime

 Project Readme

Rummageable (DEPRECATED)

This gem is deprecated. Please use gds-api-adapters.

Rummageable is a ruby gem to simplify communication with Rummager to create/update/remove items in the gov.uk search index.

It attempts to handle networking errors by retrying failed requests a few times before it'll give up, and will optionally log it's success/failure to a logger object (if you give it one).

Usage

To interact with Rummager, create an instance of the Rummageable::Index class:

index = Rummageable::Index.new('http://localhost:3009', 'index-name')

You can also pass a logger to new, and can control how aggressively Rummageable will retry your command in the event of an error. See the source for details.

Getting started

You can add individual indexable "things" to a Rummager index by passing a hash that represents the thing you want to index:

document = {
  'title' => 'Child benefit tax calculator',
  'link' => '/child-benefit-tax',
  'format' => 'smart-answer',
  'section' => nil,
  'subsection' => nil
}
index = Rummageable::Index.new('http://localhost:3009', 'index-name')
index.add(document)

The link key is special; you can use it to amend/delete the document's entry in the index later, with the Index#amend and Index#delete methods.

If you've got a large collection of documents the add_batch method will chop the collection up into manageable chunks and send them to Rummager for you.

index.add_batch(array_of_documents)

See the source of the Rummageable::Index class for other methods.