[Bug]: Milvus search fails if _node_content is not set on document

### Bug Description

If the Milvus search returns documents that don't have _node_content set, a ValueError is thrown in `metadata_dict_to_node`, even if a text_key is configured. From my understanding, this behaviour was changed in https://github.com/run-llama/llama_index/pull/18281 ([base.py line 1360 ff](https://github.com/run-llama/llama_index/commit/061275e86655f496e7d90b44dd597b61beaca318#diff-a6388c5219c5ce3b511954b8abf4cd533379b8ef739910b2791993be39365297L1295-L1313)). Until then, a if the a text_key was configured, a TextNode was created directly, without calling `metadata_dict_to_node`.

I'm not sure what the ideal behaviour is, now that the text_key is set to a default value if it's not explicitly provided. I think it would make sense to first check if `_node_content` is set, and if not, create a TextNode directly.

### Version

llama_index 0.12.47, llama_index_vector_stores_milvus 0.8.5

### Steps to Reproduce

1. Insert documents into Milvus with only a field 'text' and a vector.
2. Create a MilvusVectorStore with `text_key` set to 'text'.
3. Attempt to search for documents.

### Relevant Logs/Tracbacks

```shell
iwm_llamaindex-1  | Traceback (most recent call last):
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
iwm_llamaindex-1  |     result = await app(  # type: ignore[func-returns-value]
iwm_llamaindex-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
iwm_llamaindex-1  |     return await self.app(scope, receive, send)
iwm_llamaindex-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/fastapi/applications.py", line 1054, in __call__
iwm_llamaindex-1  |     await super().__call__(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/applications.py", line 112, in __call__
iwm_llamaindex-1  |     await self.middleware_stack(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/middleware/errors.py", line 187, in __call__
iwm_llamaindex-1  |     raise exc
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/middleware/errors.py", line 165, in __call__
iwm_llamaindex-1  |     await self.app(scope, receive, _send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/middleware/cors.py", line 93, in __call__
iwm_llamaindex-1  |     await self.simple_response(scope, receive, send, request_headers=headers)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/middleware/cors.py", line 144, in simple_response
iwm_llamaindex-1  |     await self.app(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/middleware/exceptions.py", line 62, in __call__
iwm_llamaindex-1  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
iwm_llamaindex-1  |     raise exc
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
iwm_llamaindex-1  |     await app(scope, receive, sender)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/routing.py", line 714, in __call__
iwm_llamaindex-1  |     await self.middleware_stack(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/routing.py", line 734, in app
iwm_llamaindex-1  |     await route.handle(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/routing.py", line 288, in handle
iwm_llamaindex-1  |     await self.app(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/routing.py", line 76, in app
iwm_llamaindex-1  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/_exception_handler.py", line 53, in wrapped_app
iwm_llamaindex-1  |     raise exc
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/_exception_handler.py", line 42, in wrapped_app
iwm_llamaindex-1  |     await app(scope, receive, sender)
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/starlette/routing.py", line 73, in app
iwm_llamaindex-1  |     response = await f(request)
iwm_llamaindex-1  |                ^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/fastapi/routing.py", line 301, in app
iwm_llamaindex-1  |     raw_response = await run_endpoint_function(
iwm_llamaindex-1  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/fastapi/routing.py", line 212, in run_endpoint_function
iwm_llamaindex-1  |     return await dependant.call(**values)
iwm_llamaindex-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/app/app/api/routers/chat.py", line 126, in chat
iwm_llamaindex-1  |     response = chat_engine.chat(lastMessage.content, messages)
iwm_llamaindex-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index_instrumentation/dispatcher.py", line 319, in wrapper
iwm_llamaindex-1  |     result = func(*args, **kwargs)
iwm_llamaindex-1  |              ^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/callbacks/utils.py", line 42, in wrapper
iwm_llamaindex-1  |     return func(self, *args, **kwargs)
iwm_llamaindex-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/chat_engine/condense_plus_context.py", line 324, in chat
iwm_llamaindex-1  |     synthesizer, context_source, context_nodes = self._run_c3(message, chat_history)
iwm_llamaindex-1  |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/chat_engine/condense_plus_context.py", line 272, in _run_c3
iwm_llamaindex-1  |     context_nodes = self._get_nodes(condensed_question)
iwm_llamaindex-1  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/chat_engine/condense_plus_context.py", line 207, in _get_nodes
iwm_llamaindex-1  |     nodes = self._retriever.retrieve(message)
iwm_llamaindex-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index_instrumentation/dispatcher.py", line 319, in wrapper
iwm_llamaindex-1  |     result = func(*args, **kwargs)
iwm_llamaindex-1  |              ^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/base/base_retriever.py", line 246, in retrieve
iwm_llamaindex-1  |     nodes = self._retrieve(query_bundle)
iwm_llamaindex-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index_instrumentation/dispatcher.py", line 319, in wrapper
iwm_llamaindex-1  |     result = func(*args, **kwargs)
iwm_llamaindex-1  |              ^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/indices/vector_store/retrievers/retriever.py", line 104, in _retrieve
iwm_llamaindex-1  |     return self._get_nodes_with_embeddings(query_bundle)
iwm_llamaindex-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/indices/vector_store/retrievers/retriever.py", line 181, in _get_nodes_with_embeddings
iwm_llamaindex-1  |     query_result = self._vector_store.query(query, **self._kwargs)
iwm_llamaindex-1  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/vector_stores/milvus/base.py", line 781, in query
iwm_llamaindex-1  |     nodes, similarities, ids = self._default_search(
iwm_llamaindex-1  |                                ^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/vector_stores/milvus/base.py", line 898, in _default_search
iwm_llamaindex-1  |     nodes, similarities, ids = self._parse_from_milvus_results(res)
iwm_llamaindex-1  |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/vector_stores/milvus/base.py", line 1415, in _parse_from_milvus_results
iwm_llamaindex-1  |     node = metadata_dict_to_node(metadata)
iwm_llamaindex-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
iwm_llamaindex-1  |   File "/usr/local/lib/python3.12/dist-packages/llama_index/core/vector_stores/utils.py", line 72, in metadata_dict_to_node
iwm_llamaindex-1  |     raise ValueError("Node content not found in metadata dict.")
iwm_llamaindex-1  | ValueError: Node content not found in metadata dict.
```

Labels: bug, P2
State: closed