# HG changeset patch # User Oleksandr Gavenko # Date 1510487143 -7200 # Node ID 37bf9f7b8560919cd37fc5a2c14ac168cd33e10a # Parent af2d2e117b4e3777404e5f3e6f238ca59aeec1a7 Managing indexes. Lucene search syntax. Performance. JSON search syntax. Alerting. diff -r af2d2e117b4e -r 37bf9f7b8560 elasticsearch.rst --- a/elasticsearch.rst Tue Oct 31 16:21:07 2017 +0200 +++ b/elasticsearch.rst Sun Nov 12 13:45:43 2017 +0200 @@ -20,23 +20,34 @@ Cluster health:: GET /_cat/health?v + GET /_cluster/health?pretty + GET /_cluster/health?pretty&level=cluster -List of nodes in cluster:: +List of nodes in cluster (ip, RAM, CPU):: GET /_cat/nodes?v GET /_cat/master?v -List of indexes:: +List cluster state:: + + GET /_cluster/state?pretty + +List of indexes (status, health, size):: GET /_cat/indices GET /_cat/indices?v GET /_cat/indices?v&s=index + GET /_cluster/health?pretty&level=indices List of mappings across all indexes:: GET /_mapping GET /_all/_mapping +List of shards:: + + GET /_cluster/health?pretty&level=shards + https://www.elastic.co/guide/en/elasticsearch/reference/current/_cluster_health.html Cluster Health. https://www.elastic.co/guide/en/elasticsearch/reference/current/_list_all_indices.html @@ -47,6 +58,93 @@ Managing indexes ================ +Assign number of shards and replicas:: + + curl -XPUT -d '{settings: {index: "number_of_shards": 3, "number_of_replicas": 1}}' + https://www.elastic.co/guide/en/elasticsearch/reference/current/_delete_an_index.html Delete an Index. +https://github.com/elastic/curator + Manage/archive indices. +https://www.elastic.co/guide/en/elasticsearch/client/curator/current/about.html + Elasticsearch Curator helps you curate, or manage, your Elasticsearch indices and snapshots. +https://www.elastic.co/guide/en/elasticsearch/client/curator/current/about-features.html + Curator allows for many different operations to be performed to both indices and snapshots. +https://www.elastic.co/guide/en/elasticsearch/guide/current/retiring-data.html + Retiring Data. + +Lucene search syntax +==================== + +``TERM1 TERM2`` is same as ``TERM1 OR TERM2``. + +``"TERM1 TERM2"`` is for phrase. + +``"TERM1 TERM2"~5`` is for proximity. + +``TERM~0.8`` is for fuzzy. + +``*`` is for wildcard. + +Boosting is done with ``^N`` syntax, like ``TERM1^10 TERM2``. + +Range with ``[2017-01-01 TO 2017-02-29]``. + +Logical ``AND``, ``OR``, ``NOT`` and parentheses for grouping. + +Fields are set before colon, like ``FIELD:TERM``. + +https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-query-string-query.html + Query String Query +https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-simple-query-string-query.html + Simple Query String Query + +Performance +=========== + +https://www.elastic.co/guide/en/elasticsearch/reference/5.5/search-profile.html + Profile API. +https://www.elastic.co/guide/en/elasticsearch/reference/current/_explain_analyze.html + Explain Analyze. +https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html + Explain API. + +https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-indexing-speed.html + Tune for indexing speed. +https://www.elastic.co/guide/en/elasticsearch/reference/current/tune-for-search-speed.html + Tune for search speed. + +JSON search syntax +================== + +https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html + Search results pagination. +https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html + Query String Query. +https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html + Aggregation. +https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html + Sort. + +Alerting +======== + +https://github.com/Yelp/elastalert + Easy & Flexible Alerting With Elasticsearch. +http://elastalert.readthedocs.io/en/latest/elastalert.html + Easy & Flexible Alerting With Elasticsearch. +https://github.com/sirensolutions/sentinl/wiki/SENTINL-Alerts-in-Dashboard + SENTINL Alerts in Dashboard. +https://github.com/sirensolutions/sentinl/wiki/SENTINL-Config-Example + SENTINL Config Example +https://github.com/sirensolutions/sentinl/wiki/SENTINL-Tutorial + SENTINL Tutorial +https://github.com/sirensolutions/sentinl/wiki/SENTINL-Watcher-Anatomy + SENTINL Watcher Anatomy +https://github.com/sirensolutions/sentinl/wiki/SENTINL-Watcher-Examples + SENTINL Watcher Examples + +https://sematext.com/blog/x-pack-alternatives/ + X-Pack Alternatives +