Error failed to index when using ElasticsearchStore.from_documents
Labels: name: area: doc loader, name: area: vector store, name: auto:bug

### System Info

Python : v3.10.10
Langchain : v0.0.281
Elasticsearch : v8.9.0

### Who can help?

_No response_

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [X] Document Loaders
- [X] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

I was following this documentation https://python.langchain.com/docs/integrations/vectorstores/elasticsearch
my script was

```
# GENERATE INDEXING

loader = TextLoader("models/state_of_union.txt")
documents = loader.load()
text_splitter = CharacterTextSplitter(chunk_size=100, chunk_overlap=0)
docs = text_splitter.split_documents(documents)

embeddings = OpenAIEmbeddings()

db = ElasticsearchStore.from_documents(
    docs,
    embeddings,
    es_url="http://localhost:9200",
    index_name="test-basic", 
    es_user=os.environ.get("ELASTIC_USERNAME"),
    es_password=os.environ.get("ELASTIC_PASSWORD"),
)
```


but it raising an error when indexing the document

```
Created a chunk of size 132, which is longer than the specified 100
Created a chunk of size 107, which is longer than the specified 100
Created a chunk of size 103, which is longer than the specified 100
Created a chunk of size 104, which is longer than the specified 100
Error adding texts: 336 document(s) failed to index.
First error reason: failed to parse
Traceback (most recent call last):
  File "D:\Project\elastic-langchain\main.py", line 31, in <module>
    db = ElasticsearchStore.from_documents(
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\langchain\vectorstores\elasticsearch.py", line 1027, in from_documents
    elasticsearchStore.add_documents(documents)
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\langchain\vectorstores\base.py", line 101, in add_documents
    return self.add_texts(texts, metadatas, **kwargs)
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\langchain\vectorstores\elasticsearch.py", line 881, in add_texts
    raise e
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\langchain\vectorstores\elasticsearch.py", line 868, in add_texts
    success, failed = bulk(
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\elasticsearch\helpers\actions.py", line 521, in bulk    
    for ok, item in streaming_bulk(
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\elasticsearch\helpers\actions.py", line 436, in streaming_bulk
    for data, (ok, info) in zip(
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\elasticsearch\helpers\actions.py", line 355, in _process_bulk_chunk
    yield from gen
  File "D:\Project\elastic-langchain\.venv\lib\site-packages\elasticsearch\helpers\actions.py", line 274, in _process_bulk_chunk_success
    raise BulkIndexError(f"{len(errors)} document(s) failed to index.", errors)
elasticsearch.helpers.BulkIndexError: 336 document(s) failed to index.
```

### Expected behavior

It can indexing and not raising any errror