HBase Elasticsearch Schema

HBase uses metadata of a table to store the definition of the Elasticsearch schema.

Table 1 Schema definition

Field

Description

Mandatory

hbase.index.es.enabled

Whether to create a full-text index for the HBase table in Elasticsearch. The value true indicates that the full-text index is created. The default value is false.

Yes

hbase.index.es.endpoint

Access address of the CSS cluster (Elasticsearch engine), for example, ip1:port,ip2:port

Yes

hbase.index.es.indexname

Index name of the HBase table in Elasticsearch. The index name must be in lower case.

Yes

hbase.index.es.shards

Number of index shards in Elasticsearch. The default value is 5. The value is an integer greater than or equal to 1.

No

hbase.index.es.replicas

Number of index replicas in Elasticsearch. The default value is 1. The value is an integer greater than or equal to 0.

No

hbase.index.es.schema

Field mapping between HBase and Elasticsearch. The value is characters in JSON array format. Each element contains the following fields:

  • name: Name of the field in Elasticsearch
  • type: Type of the field in Elasticsearch
  • hbaseQualifier: HBase qualifier of the data source
  • analyzer: You can configure analyzer to specify an analyzer for fields of the text type. Typically, the ik_smart analyzer is used for Chinese text. The default value is Standard, supporting English text.

Example:

'[ {"name":"contentCh","type":"text","hbaseQualifier":"cf1:contentCh","analyzer":"ik_smart"}, {"name":"contentEng","type":"text","hbaseQualifier":"cf2:contentEng"},{"name":"id","type":"long","hbaseQualifier":"cf1:id"} ]'

Yes

The data types supported by HBase-Elasticsearch full-text search are {"text", "long", "integer", "short", "byte", "double", "float","boolean"}, that is, the value type of type in the schema. text indicates the text type in Elasticsearch. Full-text search typically supports data of the text type and also supports accurate search of data of basic types.