I want to do a recursive wildcard search of a folder in the "NextCloud(SEARCH FILES)" node #368

Closed
opened 2026-02-16 10:19:09 -05:00 by yindo · 9 comments
Owner

Originally created by @hiro-gj on GitHub (Jun 15, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.1.3 → 1.5.1

Plugin version

0.0.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I tried to search for folders recursively using wildcards by entering "xxxxx/xxxxx/xxxxx/*" in search_pattern.

Dify Marketplace "NextCloud"

Search Files: Find files and folders using name patterns with wildcard support and recursive search.

Search Files
Searches for files and folders in NextCloud that match a specified name pattern.

Required parameters:

  • search_pattern: Name pattern to search for (supports wildcards like "*.txt", "report")
    Optional parameters:

  • search_path: Starting directory for search (default: "/")

  • max_results: Maximum number of results to return (default: "50")
    Note: Searches recursively through directories and supports wildcard patterns for flexible file discovery.

✔️ Error log

Search path '/xxxxx/xxxxx/xxxxx/*' not found.

Image

SEARCH FILES (Nextcloud) node
Input:

{
  "search_pattern": "*テスト*.*",
  "search_path": "xxxxx/xxxxx/xxxxx/*"
}

Output:

{
  "text": "Search path '/xxxxx/xxxxx/xxxxx/*' not found.",
  "files": [],
  "json": []
}
Originally created by @hiro-gj on GitHub (Jun 15, 2025). ### Self Checks - [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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version ~1.1.3~ → 1.5.1 ### Plugin version 0.0.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ### I tried to search for folders recursively using wildcards by entering "xxxxx/xxxxx/xxxxx/*" in search_pattern. [Dify Marketplace "NextCloud"](https://marketplace.dify.ai/plugins/langgenius/nextcloud) > **Search Files**: Find files and folders using name patterns with wildcard support and recursive search. > **Search Files** > Searches for files and folders in NextCloud that match a specified name pattern. > > Required parameters: > > - `search_pattern`: Name pattern to search for (supports wildcards like "*.txt", "report") > Optional parameters: > > - `search_path`: Starting directory for search (default: "/") > - `max_results`: Maximum number of results to return (default: "50") > *Note: Searches recursively through directories and supports wildcard patterns for flexible file discovery.* ### ✔️ Error log ### `Search path '/xxxxx/xxxxx/xxxxx/*' not found.` ![Image](https://github.com/user-attachments/assets/dac6df03-d080-4b02-9382-aaad5d029c41) SEARCH FILES (Nextcloud) node Input: ``` { "search_pattern": "*テスト*.*", "search_path": "xxxxx/xxxxx/xxxxx/*" } ``` Output: ``` { "text": "Search path '/xxxxx/xxxxx/xxxxx/*' not found.", "files": [], "json": [] } ```
yindo added the bug label 2026-02-16 10:19:09 -05:00
yindo closed this issue 2026-02-16 10:19:09 -05:00
Author
Owner

@hiro-gj commented on GitHub (Jun 15, 2025):

Perhaps this also requires integration with an Elasticsearch server?

Nextcloudの検索機能を使ってファイルを探すのですが、デフォルトの検索機能はファイル名しか検索しないためファイル名を思い出せなければ見つけ出すことができません。

しかし、Nextcloudに全文検索機能プラグインを追加し、Elasticsearchサーバーに登録すれば、ファイルの内容でファイルを検索できます。

@hiro-gj commented on GitHub (Jun 15, 2025): Perhaps this also requires integration with an Elasticsearch server? - [Nextcloudの全文検索機能と検索テクニック | Nextcloud日本公式サイト](https://nextcloud.stylez.co.jp/blog/techblog/nextcloud-fulltextsearch-search_tips.html) > Nextcloudの検索機能を使ってファイルを探すのですが、デフォルトの検索機能はファイル名しか検索しないためファイル名を思い出せなければ見つけ出すことができません。 > > しかし、Nextcloudに全文検索機能プラグインを追加し、Elasticsearchサーバーに登録すれば、ファイルの内容でファイルを検索できます。 - [Elasticsearch - Dify Marketplace](https://marketplace.dify.ai/plugins/quicksandzn/elasticsearch)
Author
Owner

@hiro-gj commented on GitHub (Jul 7, 2025):

@langgenius
Sorry, please help me !
What is the best practice for recursive file search with "NextCloud(SEARCH FILES)"?

@hiro-gj commented on GitHub (Jul 7, 2025): @langgenius Sorry, please help me ! What is the best practice for recursive file search with "NextCloud(SEARCH FILES)"?
Author
Owner

@hiro-gj commented on GitHub (Jul 8, 2025):

"search_files_0.0.1a.py"
@langgenius The directory path output is still strange... ,
Originally: /test1/test2/テスト3.md
Currently: /test1/テスト3.md --> The test2 directory is not displayed.
but now I can search directories recursively !

Image

search_files_0.0.1a.py.zip

  • search_files_0.0.1a.py
  • diff_search_files_0.0.1a.htm
  • NextCloud Plugin for Dify Test.yml
@hiro-gj commented on GitHub (Jul 8, 2025): **"search_files_0.0.1a.py"** @langgenius The directory path output is still strange... , `Originally: /test1/test2/テスト3.md` `Currently: /test1/テスト3.md` --> The test2 directory is not displayed. but now I can search directories recursively ! <img width="1486" height="835" alt="Image" src="https://github.com/user-attachments/assets/1a4d7c4a-afac-4c98-861f-18d7f1be42ca" /> [search_files_0.0.1a.py.zip](https://github.com/user-attachments/files/21115508/search_files_0.0.1a.py.zip) - search_files_0.0.1a.py - diff_search_files_0.0.1a.htm - NextCloud Plugin for Dify Test.yml
Author
Owner

@hiro-gj commented on GitHub (Jul 8, 2025):

Proposal for modification

The directory path output is still strange... ,
Originally: /test1/test2/テスト3.md
Currently: /test1/テスト3.md --> The test2 directory is not displayed.

The value of "search_files_0.0.1a.py" Output is,
currently as follows,

{
  "text": "[DEBUG] candidate: test1/, candidate: test2/, matching_dirs: ['/test1/test1', '/test1/test2'][DEBUG] Recursing into /test1/test1 with pattern *テスト*.*[DEBUG] Recursing into /test1/test2 with pattern *テスト*.*Found 1 items matching '*テスト*.*' in '/test1/*'",
  "files": [],
  "json": [
    {
      "max_results": 3,
      "results": [
        {
          "name": "テスト3.md",
          "path": "テスト3.md",
          "type": "file"
        }
      ],
      "search_path": "/test1/*",
      "search_pattern": "*テスト*.*",
      "total_found": 1
    }
  ]
}

For example, it would be good if the actual file path could be output to the value of results.path, such as "/test1/test2", as shown below.
(If the file is found in the /test1 directory, it will be "/test1".)

{
  "text": "[DEBUG] candidate: test1/, candidate: test2/, matching_dirs: ['/test1/test1', '/test1/test2'][DEBUG] Recursing into /test1/test1 with pattern *テスト*.*[DEBUG] Recursing into /test1/test2 with pattern *テスト*.*Found 1 items matching '*テスト*.*' in '/test1/*'",
  "files": [],
  "json": [
    {
      "max_results": 3,
      "results": [
        {
          "name": "テスト3.md",
          "path": "/test1/test2",
          "type": "file"
        }
      ],
      "search_path": "/test1/*",
      "search_pattern": "*テスト*.*",
      "total_found": 1
    }
  ]
}
@hiro-gj commented on GitHub (Jul 8, 2025): ## Proposal for modification > The directory path output is still strange... , > Originally: /test1/test2/テスト3.md > Currently: /test1/テスト3.md --> The test2 directory is not displayed. The value of "search_files_0.0.1a.py" Output is, currently as follows, ``` { "text": "[DEBUG] candidate: test1/, candidate: test2/, matching_dirs: ['/test1/test1', '/test1/test2'][DEBUG] Recursing into /test1/test1 with pattern *テスト*.*[DEBUG] Recursing into /test1/test2 with pattern *テスト*.*Found 1 items matching '*テスト*.*' in '/test1/*'", "files": [], "json": [ { "max_results": 3, "results": [ { "name": "テスト3.md", "path": "テスト3.md", "type": "file" } ], "search_path": "/test1/*", "search_pattern": "*テスト*.*", "total_found": 1 } ] } ``` For example, it would be good if the actual file path could be output to the value of `results.path`, such as "/test1/test2", as shown below. (If the file is found in the /test1 directory, it will be "/test1".) ``` { "text": "[DEBUG] candidate: test1/, candidate: test2/, matching_dirs: ['/test1/test1', '/test1/test2'][DEBUG] Recursing into /test1/test1 with pattern *テスト*.*[DEBUG] Recursing into /test1/test2 with pattern *テスト*.*Found 1 items matching '*テスト*.*' in '/test1/*'", "files": [], "json": [ { "max_results": 3, "results": [ { "name": "テスト3.md", "path": "/test1/test2", "type": "file" } ], "search_path": "/test1/*", "search_pattern": "*テスト*.*", "total_found": 1 } ] } ```
Author
Owner

@hiro-gj commented on GitHub (Jul 14, 2025):

Pythonで条件を満たすパスの一覧を再帰的に取得するglobの使い方 | note.nkmk.me

再帰的に取得: 引数recursive
glob()の引数recursiveをTrueとして**を使うと、あらゆるファイルや0個以上のディレクトリおよびサブディレクトリにマッチする。

(Translated into English)

Get recursively: argument recursive
Using glob() with the argument recursive set to True, **, matches any file or zero or more directories and subdirectories.

Could it be this!?
"test1/*" -> "test1/**"

First, try test1/** with langgenius-nextcloud_0.0.1.difypkg...

[Input]

{
  "max_results": "50",
  "search_path": "test1/**",
  "search_pattern": "*テスト*.*"
}

[Output]

{
  "text": "Search path '/test1/**' not found.",
  "files": [],
  "json": []
}

It didn't work...
But I think I can see a slight direction for improvement.

@hiro-gj commented on GitHub (Jul 14, 2025): [Pythonで条件を満たすパスの一覧を再帰的に取得するglobの使い方 | note.nkmk.me](https://note.nkmk.me/python-glob-usage/) > **再帰的に取得: 引数recursive** > `glob()`の引数recursiveをTrueとして`**`を使うと、あらゆるファイルや0個以上のディレクトリおよびサブディレクトリにマッチする。 (Translated into English) > **Get recursively: argument recursive** > Using `glob()` with the argument recursive set to True, `**`, matches any file or zero or more directories and subdirectories. Could it be this!? "test1/*" -> "test1/**" First, try `test1/**` with `langgenius-nextcloud_0.0.1.difypkg`... [Input] ``` { "max_results": "50", "search_path": "test1/**", "search_pattern": "*テスト*.*" } ``` [Output] ``` { "text": "Search path '/test1/**' not found.", "files": [], "json": [] } ``` It didn't work... But I think I can see a slight direction for improvement.
Author
Owner

@hiro-gj commented on GitHub (Jul 14, 2025):

"search_files_0.0.1a-20250715.py"

nice! nice!

Image 1 Image 2

  • Input
{
  "max_results": "50",
  "search_path": "test1/**",
  "search_pattern": "テスト"
}
  • Output
{
  "text": "Found 1 items matching 'テストテスト6.md' in '/test1/test4/test5', Found 1 items matching 'テスト3.md' in '/test1/test2'",
  "files": [],
  "json": [
    {
      "max_results": 50,
      "results": [
        {
          "name": "テストテスト6.md",
          "path": "/test1/test4/test5",
          "type": "file"
        },
        {
          "name": "テスト3.md",
          "path": "/test1/test2",
          "type": "file"
        }
      ],
      "search_path": "test1/**",
      "search_pattern": "テスト",
      "total_found": 2
    }
  ]
}

search_files_0.0.1a-20250715.zip

@hiro-gj commented on GitHub (Jul 14, 2025): **"search_files_0.0.1a-20250715.py"** nice! nice! <table> <tr> <td> <img src="https://github.com/user-attachments/assets/ad971987-d348-45b5-ba7b-7df9fb3efbbc" alt="Image 1"> </td> <td> <img src="https://github.com/user-attachments/assets/d9804a4c-8499-419d-b8c3-be261c19efbd" alt="Image 2"> </td> </tr> </table> - I chose to use Nextcloud's Nextcloud search API (OCS version). - https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/search.html - `GET https://cloud.domain/ocs/v2.php/search/providers/files/search?term=テスト` --- - Input ``` { "max_results": "50", "search_path": "test1/**", "search_pattern": "テスト" } ``` - Output ``` { "text": "Found 1 items matching 'テストテスト6.md' in '/test1/test4/test5', Found 1 items matching 'テスト3.md' in '/test1/test2'", "files": [], "json": [ { "max_results": 50, "results": [ { "name": "テストテスト6.md", "path": "/test1/test4/test5", "type": "file" }, { "name": "テスト3.md", "path": "/test1/test2", "type": "file" } ], "search_path": "test1/**", "search_pattern": "テスト", "total_found": 2 } ] } ``` [search_files_0.0.1a-20250715.zip](https://github.com/user-attachments/files/21224381/search_files_0.0.1a-20250715.zip)
Author
Owner

@hiro-gj commented on GitHub (Jul 14, 2025):

@konashi-j-st4 Excuse me, please help me with testing and PR.
https://github.com/langgenius/dify-official-plugins/issues/1092#issuecomment-3071619888

Image

DSL_(テスト)NextCloud Plugin for Dify Test.yml.zip
langgenius-nextcloud_0.0.1a-20250715.difypkg.zip ← Forced replacement of search_files.py with 7-zip.

@hiro-gj commented on GitHub (Jul 14, 2025): @konashi-j-st4 Excuse me, please help me with testing and PR. https://github.com/langgenius/dify-official-plugins/issues/1092#issuecomment-3071619888 <img width="1169" height="802" alt="Image" src="https://github.com/user-attachments/assets/1fac1e19-9ca3-45a3-ab04-9728c376c8a2" /> [DSL_(テスト)NextCloud Plugin for Dify Test.yml.zip](https://github.com/user-attachments/files/21224838/DSL_.NextCloud.Plugin.for.Dify.Test.yml.zip) [langgenius-nextcloud_0.0.1a-20250715.difypkg.zip](https://github.com/user-attachments/files/21224837/langgenius-nextcloud_0.0.1a-20250715.difypkg.zip) ← Forced replacement of search_files.py with 7-zip.
Author
Owner

@hiro-gj commented on GitHub (Jul 28, 2025):

Nextcloud's general search itself does not support file extension searches such as "*.txt"

Instead of the "Webdav search method" used in the original "0.0.1,"
the "0.0.1a-20250715" update has been changed to "using the Nextcloud OCS API."

As a result, the search term specification specifications also conform to Nextcloud.

For example, searches specifying extensions such as "*.txt" are not possible.

Instead, recursive searches, which were not possible in "0.0.1", are now provided by the Nextcloud OCS API.

(example:Nextcloud's general search itself does not support file extension searches such as "*.txt")

https://github.com/user-attachments/assets/890390ab-4f82-4322-8dc8-e43e6c3f636b

@hiro-gj commented on GitHub (Jul 28, 2025): ### Nextcloud's general search itself does not support file extension searches such as "*.txt" Instead of the "Webdav search method" used in the original "0.0.1," the "0.0.1a-20250715" update has been changed to "using the Nextcloud OCS API." As a result, the search term specification specifications also conform to Nextcloud. For example, searches specifying extensions such as "*.txt" are not possible. Instead, recursive searches, which were not possible in "0.0.1", are now provided by the Nextcloud OCS API. (example:Nextcloud's general search itself does not support file extension searches such as "*.txt") https://github.com/user-attachments/assets/890390ab-4f82-4322-8dc8-e43e6c3f636b
Author
Owner

@hiro-gj commented on GitHub (Jul 30, 2025):

It's pull request has been made regarding this issue, so I will close it !
https://github.com/langgenius/dify-official-plugins/pull/1377

@hiro-gj commented on GitHub (Jul 30, 2025): It's pull request has been made regarding this issue, so I will close it ! https://github.com/langgenius/dify-official-plugins/pull/1377
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#368