Skip to content

[Feature request] FileTextSearcher - return text #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
markgibbons25 opened this issue Sep 20, 2022 · 3 comments
Open

[Feature request] FileTextSearcher - return text #1

markgibbons25 opened this issue Sep 20, 2022 · 3 comments

Comments

@markgibbons25
Copy link

markgibbons25 commented Sep 20, 2022

Thanks for open sourcing this!
Currently would need to re-read the whole file if we need to check the text of the matching file, which is inefficient I think, would be good to have an option to return the text in the result.

@VladPVS
Copy link
Owner

VladPVS commented Sep 20, 2022

Hello!
First of all, thank you for your feedback.
It always pleasantly to realize that work was useful and it wasn't done in vain.
This library has been written only for research purposes and intended for distribution among anyone who needs it.
It was never used in any production, at least by me.

Regarding your suggestion,
I was testing library on set of small text files (usually less than 100 Kb each),
therefore they were read from SSD almost immediately.

Probably, in some specific cases, apparently like yours, found files may be large and it makes sense to add option
to return file content together with the its path.

I could try to add the appropriate property to FileEventArgs class.
Thus, file content will be available throught event properties when one uses FileTextSearcher class.

What do you think about it?

@markgibbons25
Copy link
Author

Yep that sounds good. I admit that this tool runs so fast that this wouldn't be any major performance improvement, and I suppose it could have a down side of more memory usage. At the moment I'm just using the FileSearcher and then reading the files in the FilesFound event, but my code isn't quite as multi-thread-optimized as yours is.

@VladPVS
Copy link
Owner

VladPVS commented Sep 21, 2022

I added possibility to get file content with the file path, but since these changes cover only this particular case
and need much time for testing, so I suppose it's unjustified to make available this version for everyone. Could you give your email or please write me on putchenko.vs@gmail.com?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants