setting vector_store=milvus doesnt work #21198

Closed
opened 2026-02-21 20:11:23 -05:00 by yindo · 1 comment
Owner

Originally created by @wuyanzu on GitHub (Dec 21, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Imageit happens when recall testing.

Imageand my .env setting. and milvus is running well in container

✔️ Expected Behavior

running well

Actual Behavior

No response

Originally created by @wuyanzu on GitHub (Dec 21, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="1001" height="140" alt="Image" src="https://github.com/user-attachments/assets/295a8f1d-6eef-45bd-afa8-70c093acb86f" />it happens when recall testing. <img width="593" height="166" alt="Image" src="https://github.com/user-attachments/assets/b2d1a86c-d8bb-45d1-bfad-908f984e814b" />and my .env setting. and milvus is running well in container ### ✔️ Expected Behavior running well ### ❌ Actual Behavior _No response_
yindo added the 👻 feat:rag label 2026-02-21 20:11:23 -05:00
yindo closed this issue 2026-02-21 20:11:23 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 21, 2025):

Hi @wuyanzu! I'm Dosu and I’m helping the dify team.

Changing VECTOR_STORE in your .env only affects new datasets or those that have never been indexed. If a dataset was previously indexed with Weaviate, Dify will keep trying to use Weaviate for that dataset—even after you switch to Milvus—because the dataset’s index_struct_dict['type'] takes precedence over the global setting. To force Dify to use Milvus, you need to rebuild or delete the dataset index so it can be recreated with the new backend. Be aware this may require re-indexing your data and could result in data loss if not handled carefully.

Also, double-check that Milvus is accessible from the Dify container (not just running) and that Docker networking is set up correctly—avoid using 127.0.0.1 for inter-container communication; use the container name or Docker network IP instead.

If you still see issues after resetting the index, check the Dify backend logs for more details on which vector store it’s trying to use and any connection errors.

For more on how Dify selects the vector backend, see the relevant code logic here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 21, 2025): <!-- Greeting --> Hi @wuyanzu! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> Changing VECTOR_STORE in your .env only affects new datasets or those that have never been indexed. If a dataset was previously indexed with Weaviate, Dify will keep trying to use Weaviate for that dataset—even after you switch to Milvus—because the dataset’s index_struct_dict['type'] takes precedence over the global setting. To force Dify to use Milvus, you need to rebuild or delete the dataset index so it can be recreated with the new backend. Be aware this may require re-indexing your data and could result in data loss if not handled carefully. Also, double-check that Milvus is accessible from the Dify container (not just running) and that Docker networking is set up correctly—avoid using 127.0.0.1 for inter-container communication; use the container name or Docker network IP instead. If you still see issues after resetting the index, check the Dify backend logs for more details on which vector store it’s trying to use and any connection errors. For more on how Dify selects the vector backend, see the relevant code logic [here](https://github.com/langgenius/dify/blob/ba73964dfd8f99459a14a73a2297a92ab9c6f156/api/core/rag/datasource/vdb/vector_factory.py#L48-L196). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/aab48dbc-0e3e-4e9c-ba54-727880a8ecba?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Changing%20VECTOR_STORE%20in%20your%20.env%20only%20affects%20new%20datasets%20or%20those%20that%20have%20never%20been%20indexed.%20If%20a%20dataset%20was%20previously%20indexed%20with%20Weaviate%2C%20Dify%20will%20keep%20trying%20to%20use%20Weaviate%20for%20that%20dataset%E2%80%94even%20after%20you%20switch%20to%20Milvus%E2%80%94because%20the%20dataset%E2%80%99s%20index_struct_dict%5B%27type%27%5D%20takes%20precedence%20over%20the%20global%20setting.%20To%20force%20Dify%20to%20use%20Milvus%2C%20you%20need%20to%20rebuild%20or%20delete%20the%20dataset%20index%20so%20it%20can%20be%20recreated%20with%20the%20new%20backend.%20Be%20aware%20this%20may%20require%20re-indexing%20your%20data%20and%20could%20result%20in%20data%20loss%20if%20not%20handled%20carefully.%20%0A%0AAlso%2C%20double-check%20that%20Milvus%20is%20accessible%20from%20the%20Dify%20container%20%28not%20just%20running%29%20and%20that%20Docker%20networking%20is%20set%20up%20correctly%E2%80%94avoid%20using%20127.0.0.1%20for%20inter-container%20communication%3B%20use%20the%20container%20name%20or%20Docker%20network%20IP%20instead.%20%0A%0AIf%20you%20still%20see%20issues%20after%20resetting%20the%20index%2C%20check%20the%20Dify%20backend%20logs%20for%20more%20details%20on%20which%20vector%20store%20it%E2%80%99s%20trying%20to%20use%20and%20any%20connection%20errors.%20%0A%0AFor%20more%20on%20how%20Dify%20selects%20the%20vector%20backend%2C%20see%20the%20relevant%20code%20logic%20%5Bhere%5D%28https%3A//github.com/langgenius/dify/blob/ba73964dfd8f99459a14a73a2297a92ab9c6f156/api/core/rag/datasource/vdb/vector_factory.py%23L48-L196%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29975)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21198