NAME

ElasticSearchX::Model::Index

VERSION

version 2.0.1

ATTRIBUTES

name

The name of the index.

alias_for

If given, this name is used as the index name in ElasticSearch. The "name" is added as alias to "alias_for".

dynamic

By default, indices are not dynamic. That means that fields that are unknown to the ElasticSearch mapping will not be indexed and no dynamic mapping will be auto generated. Since the mapping is generated by this module, there is no need to have the dynamic mapping enabled. If you want to enable it anyway, set this attribute to 1 value.

namespace

Types are loaded from this namespace if they are not explicitly defined using "types". The namespace defaults to the package name of the model.

refresh_interval

This string defines the interval in which the index is refreshed and new documents are made available to the search. It defaults to 1s and can be set to -1 to disable refreshing completely.

Indices can be refreshed manually by calling "refresh".

types

A HashRef where the key is an indentifier for the value, the ElasticSearchX::Model::Document meta object. This attribute is automatically built if it isn't provided. It uses "namespace" to look for ElasticSearchX::Model::Document classes. The name is derived from the class name by lowercasing the last name segment (i.e. MyModel::Tweet becomes tweet).

traits

An ArrayRef of traits which are applied to the index object. This is useful if you want to alter the behaviour of methods like "deploy".

model

This attribute is set automatically by the model class when you add an index. It can be used to access the model through the index object.

shards

replicas

Sets the number of shards and replicas. Both default to 1.

refresh_interval

Sets the refresh interval. Defaults to 1s.

es

The ElasticSearch object.

bulk

Returns an instance of ElasticSearchX::Model::Bulk.

METHODS

refresh

Refresh index manually.

delete

Delete an index from ElasticSearch.

AUTHOR

Moritz Onken

COPYRIGHT AND LICENSE

This software is Copyright (c) 2019 by Moritz Onken.

This is free software, licensed under:

The (three-clause) BSD License