<commit_before>:Sample Code:
    .. code-block:: python
        :caption: Create an index and put data to Elasticsearch

        import datetime
        import json

        from elasticsearch import Elasticsearch
        import pytablewriter as ptw

        es = Elasticsearch(hosts="localhost:9200")

        writer = ptw.ElasticsearchWriter()
        writer.stream = es
        writer.index_name = "es writer example"
        writer.header_list = [
            "str", "byte", "short", "int", "long", "float", "date", "bool", "ip",
        ]
        writer.value_matrix = [
            [
                "abc", 100, 10000, 2000000000, 200000000000, 0.1,
                datetime.datetime(2017, 1, 2, 3, 4, 5), True, "127.0.0.1",
            ],
            [
                "def", -10, -1000, -200000000, -20000000000, 100.1,
                datetime.datetime(2017, 6, 5, 4, 5, 2), False, "::1",
            ],
        ]

        # delete existing index ---
        es.indices.delete(index=writer.index_name, ignore=404)

        # create an index and put data ---
        writer.write_table()

        # display the result ---
        es.indices.refresh(index=writer.index_name)

        print("----- mappings -----")
        response = es.indices.get_mapping(index=writer.index_name, doc_type="table")
        print("{}\n".format(json.dumps(response, indent=4)))

        print("----- documents -----")
        response = es.search(
            index=writer.index_name,
            doc_type="table",
            body={
                "query": {"match_all": {}}
            }
        )
        for hit in response["hits"]["hits"]:
            print(json.dumps(hit["_source"], indent=4))


:Output:
    .. code-block:: json

        ----- mappings -----
        {
            "es_writer_example": {
                "mappings": {
                    "table": {
                        "properties": {
                            "bool": {
                                "type": "boolean"
                            },
                            "byte": {
                                "type": "byte"
                            },
                            "date": {
                                "type": "date",
                                "format": "date_optional_time"
                            },
                            "float": {
                                "type": "double"
                            },
                            "int": {
                                "type": "integer"
                            },
                            "ip": {
                                "type": "ip"
                            },
                            "long": {
                                "type": "long"
                            },
                            "short": {
                                "type": "short"
                            },
                            "str": {
                                "type": "text"
                            }
                        }
                    }
                }
            }
        }

        ----- documents -----
        {
            "str": "abc",
            "byte": 100,
            "short": 10000,
            "int": 2000000000,
            "long": 200000000000,
            "float": 0.1,
            "date": "2017-01-02T03:04:05",
            "bool": true,
            "ip": "127.0.0.1"
        }
        {
            "str": "def",
            "byte": -10,
            "short": -1000,
            "int": -200000000,
            "long": -20000000000,
            "float": 100.1,
            "date": "2017-06-05T04:05:02",
            "bool": false,
            "ip": "::1"
        }
<commit_msg>Update docs<commit_after>:Sample Code:
    .. code-block:: python
        :caption: Create an index and put data to Elasticsearch

        import datetime
        import json

        from elasticsearch import Elasticsearch
        import pytablewriter as ptw

        es = Elasticsearch(hosts="localhost:9200")

        writer = ptw.ElasticsearchWriter()
        writer.stream = es
        writer.index_name = "es writer example"
        writer.header_list = [
            "str", "byte", "short", "int", "long", "float", "date", "bool", "ip",
        ]
        writer.value_matrix = [
            [
                "abc", 100, 10000, 2000000000, 200000000000, 0.1,
                datetime.datetime(2017, 1, 2, 3, 4, 5), True, "127.0.0.1",
            ],
            [
                "def", -10, -1000, -200000000, -20000000000, 100.1,
                datetime.datetime(2017, 6, 5, 4, 5, 2), False, "::1",
            ],
        ]

        # delete existing index ---
        es.indices.delete(index=writer.index_name, ignore=404)

        # create an index and put data ---
        writer.write_table()

        # display the result ---
        es.indices.refresh(index=writer.index_name)

        print("----- mappings -----")
        response = es.indices.get_mapping(index=writer.index_name, doc_type="table")
        print("{}\n".format(json.dumps(response, indent=4)))

        print("----- documents -----")
        response = es.search(
            index=writer.index_name,
            doc_type="table",
            body={
                "query": {"match_all": {}}
            }
        )
        for hit in response["hits"]["hits"]:
            print(json.dumps(hit["_source"], indent=4))


:Output:
    .. code-block:: json

        ----- mappings -----
        {
            "es_writer_example": {
                "mappings": {
                    "table": {
                        "properties": {
                            "bool": {
                                "type": "boolean"
                            },
                            "byte": {
                                "type": "byte"
                            },
                            "date": {
                                "type": "date",
                                "format": "date_optional_time"
                            },
                            "float": {
                                "type": "double"
                            },
                            "int": {
                                "type": "integer"
                            },
                            "ip": {
                                "type": "text"
                            },
                            "long": {
                                "type": "long"
                            },
                            "short": {
                                "type": "short"
                            },
                            "str": {
                                "type": "text"
                            }
                        }
                    }
                }
            }
        }

        ----- documents -----
        {
            "str": "def",
            "byte": -10,
            "short": -1000,
            "int": -200000000,
            "long": -20000000000,
            "float": 100.1,
            "date": "2017-06-05T04:05:02",
            "bool": false,
            "ip": "::1"
        }
        {
            "str": "abc",
            "byte": 100,
            "short": 10000,
            "int": 2000000000,
            "long": 200000000000,
            "float": 0.1,
            "date": "2017-01-02T03:04:05",
            "bool": true,
            "ip": "127.0.0.1"
        }

{'fraction_non_alphanumeric': 0.13644910018802042, 'fraction_numerical': 0.0518399140478109, 'mean_word_length': 0.8351404632824051, 'pattern_counts': {'":': 90, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 16, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3399579', 'n_tokens_mistral': 2205, 'n_tokens_neox': 1863, 'n_words': 373}