Repository is archived
No commit activity in last 3 years
No release in over 3 years
lita-elasticsearch-indexer is a lurker-bot that silently indexes all messages posted by all users in any room to which it has been invited. It can also index private messages sent directly to the bot. The bot will not index any messages posted to rooms to which it has not been invited.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 3.0.0

Runtime

 Project Readme

lita-elasticsearch-indexer

A Lita handler plugin that indexes messages to Elasticsearch.

Installation

Add lita-elasticsearch-indexer to your Lita instance's Gemfile:

gem "lita-elasticsearch-indexer"

Configuration

Required

  • elasticsearch_url (String) - Host url for the Elasticsearch instance
  • elasticsearch_index_name (String) - The name of the Elasticsearch index

Optional

  • elasticsearch_index_type (String) - The Elasticsearch document type. (default: 'message')
  • elasticsearch_index_options (Proc) - A ruby Proc or lambda used to set index parameters or override the index body.

Usage

lita-elasticsearch-indexer is a lurker-bot that silently indexes all messages posted by all users in any room to which it has been invited. It can also index private messages sent directly to the bot. The bot will not index any messages posted to rooms to which it has not been invited.

Setting elasticsearch index options with a Proc

Any of the optional arguments for Elasticsearch::API::Actions index can be set via elasticsearch_index_options by creating a Proc (or lambda) that returns a Hash. The hash will be merged with the required parameters and passed directly to the elasticsearch client index method.

config.handlers.elasticsearch_indexer.elasticsearch_index_options = lambda {|response|
  options = {}
  if response.message.extensions[:slack]
    options[:id] = response.room.id + '-' + response.message.extensions[:slack][:timestamp]
  end
  options
}