[GH-ISSUE #1959] [FEAT]: filter data connector for only selected filetypes #1272

Closed
opened 2026-02-22 18:24:01 -05:00 by yindo · 4 comments
Owner

Originally created by @DipFlip on GitHub (Jul 24, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1959

What would you like to see?

Just like we can write a list of files to IGNORE for the Github/Gitlab data connectors currently, tt would be nice to be able to collect files of ONLY certain types. A typical use case could be when a user wants to collect only pdf or text files scattered among lots of different filetypes.

This feature could look like a toggle by the current file filter. A user could toggle the file filter between ignoring the given patterns to selecting only files matching the patterns.

Originally created by @DipFlip on GitHub (Jul 24, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1959 ### What would you like to see? Just like we can write a list of files to IGNORE for the Github/Gitlab data connectors currently, tt would be nice to be able to collect files of ONLY certain types. A typical use case could be when a user wants to collect only pdf or text files scattered among lots of different filetypes. This feature could look like a toggle by the current file filter. A user could toggle the file filter between ignoring the given patterns to selecting only files matching the patterns.
yindo added the enhancementfeature request labels 2026-02-22 18:24:01 -05:00
yindo closed this issue 2026-02-22 18:24:01 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jul 24, 2024):

You should be able to use the glob syntax like .ignore files allow you to. And by that logic inversing should work as well.
So to get only scattered pdfs

*, !*.pdf

untested - if that does not work that way - it should.

IMO the only reason it is like that is because of Langchains loader but in my head it should be a selector not an omission control and by default it omits nothing.

@timothycarambat commented on GitHub (Jul 24, 2024): You _should_ be able to use the `glob` syntax like `.ignore` files allow you to. And by that logic inversing should work as well. So to get only scattered pdfs ```.gitignore *, !*.pdf ``` _untested_ - if that does not work that way - it _should_. IMO the only reason it is like that is because of Langchains loader but in my head it should be a _selector_ not an omission control and by default it omits nothing.
Author
Owner

@DipFlip commented on GitHub (Jul 25, 2024):

That's a good idea too. I've tested the github data collector and can't get it to collect all files of a type. I set the ignores to * and !**/*.txt and try to collect this test repo. It only finds files in the root folder and not subfolders.

@DipFlip commented on GitHub (Jul 25, 2024): That's a good idea too. I've tested the github data collector and can't get it to collect all files of a type. I set the ignores to `*` and `!**/*.txt` and try to collect [this test repo](https://github.com/DipFlip/rag_test_repo). It only finds files in the root folder and not subfolders.
Author
Owner

@DipFlip commented on GitHub (Jul 25, 2024):

opened an issue on langchain https://github.com/langchain-ai/langchainjs/issues/6214

@DipFlip commented on GitHub (Jul 25, 2024): opened an issue on langchain https://github.com/langchain-ai/langchainjs/issues/6214
Author
Owner

@DipFlip commented on GitHub (Jul 29, 2024):

Fixed the issue in https://github.com/langchain-ai/langchainjs/commit/36d8479166645f2bc66e4888fb70d969b1a3c51a so the pattern below should work once a new langchain release comes out and is updated here on anything-llm.

This is the correct pattern to select only pdf files, including ones in subfolders:

*,  !*/,  !**/*.pdf
@DipFlip commented on GitHub (Jul 29, 2024): Fixed the issue in https://github.com/langchain-ai/langchainjs/commit/36d8479166645f2bc66e4888fb70d969b1a3c51a so the pattern below should work once a new langchain release comes out and is updated here on anything-llm. This is the correct pattern to select only `pdf` files, including ones in subfolders: ```gitignore *, !*/, !**/*.pdf ```
yindo changed title from [FEAT]: filter data connector for only selected filetypes to [GH-ISSUE #1959] [FEAT]: filter data connector for only selected filetypes 2026-06-05 14:39:52 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1272