Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
A small (one might even say 'micro') service that hooks into pg-orm models and generates elasticsearch indices.
search-ingest
exposes a REST API to reindex/backfill specific models.
SearchIngest::MANAGED_TABLES
with an array of (T < PgORM::Base).class
ELASTIC_HOST
and ELASTIC_PORT
env vars, or through switches on the command linePG_DATABASE_URL
env varDeletes indexes and recreates index mappings. Backfills the indices by default (toggle with backfill boolean).
Backfills all indexes with data from PostgreSQL.
Healthcheck.
es_type
to specify the correct field datatype for the index schema.belongs_to
associations are modeled with ES join
datatypes, associated documents are replicated in their parent's index. This is necessary for has_parent
and has_child
queries.SearchIngest::TableManager
hooks into the changefeed of a table, resolves associations of the model and creates/updates documents in the appropriate ES indices.
ENV
: A value of production
lowers log verbosityES_HOST
: Elasticsearch hostES_PORT
: Elasticsearch portES_TLS
: Use Elasticsearch https, default is false
ES_URI
: Elasticsearch uri, detects whether to use TLS off schemaES_DISABLE_BULK
: Use single requests to Elasticsearch instead of the bulk API. Defaults to false
ES_CONN_POOL_TIMEOUT
: Timeout when checking a connection out of the Elasticsearch connection poolES_CONN_POOL
: Size of the Elasticsearch connection poolES_IDLE_POOL
: Maximum number of idle connections in the Elasticsearch connection poolUDP_LOG_HOST
: Host for sending JSON formatted logs toUDP_LOG_PORT
: Port that UDP input service is listening onPG_DATABASE
: DB to mirror to Elasticsearch, defaults to "test"
PG_HOST
: Host of PostgreSQL, defaults to localhost
PG_PORT
: Port of PostgreSQL, defaults to 5432
PG_USER
: PostgreSQL database user, defaults to postgres
PG_PWD
: PostgreSQL database password, defaults to ""
PLACE_SEARCH_INGEST_HOST
: Host to bind server toPLACE_SEARCH_INGEST_PORT
: Port for server to listen onSee CONTRIBUTING.md
.